git_policy_cli/lock/mod.rs
1//! What:
2//! Locks and their owners:
3//! the index lock,
4//! stale reference locks,
5//! and the claims that let one command work on a worktree.
6//! Why:
7//! Every lock question has one answer in one place.
8//!
9//! In TS you'd write (pseudocode):
10//! ```ts
11//! // lock/index.ts: one `export * from './file'` per module below.
12//! ```
13
14/// Controls for the lock files a stopped Git child must not leave behind.
15#[cfg(test)]
16mod git_stop_lock_tests;
17
18/// Processes holding a lock file open,
19/// found by device and inode.
20pub mod index_lock_holders;
21
22/// Parsers of `lsof -F pcDi` records and Restart Manager lines,
23/// matched by device and inode.
24pub mod index_lock_holder_parsers;
25
26/// Evidence about a foreign `index.lock` and the verdict it supports.
27pub mod index_lock_evidence;
28
29/// Index-writer classification and the commands that coordinate with a landing.
30pub mod index_writer_commands;
31
32/// The wait for any program's hold on `index.lock` before a command changes the checkout.
33pub mod index_holder_wait;
34
35/// Waiting for a foreign index.lock under the classification rules and Git's backoff schedule.
36pub mod index_lock_wait;
37
38/// Running a coordinated forwarded index writer:
39/// the landing lock held while real Git runs as a child.
40pub mod index_writer_forward;
41
42/// The lock files a stopped Git child leaves behind, found and removed once the child and what it started are gone.
43pub mod stopped_git_locks;
44
45/// The reference locks a killed Git left behind: judged one by one, removed on a proof, otherwise described.
46pub mod stale_ref_locks;
47
48/// The record of one judged reference lock and the outcome of a clearing pass.
49pub mod stale_ref_lock_found;
50
51/// Which files below a Git directory are reference locks.
52pub mod stale_ref_lock_walk;
53
54/// A file's identity at the moment it was judged, so the removal can tell it from a new file at the same path.
55pub mod stale_ref_lock_identity;
56
57/// How one reference lock is judged.
58pub mod stale_ref_lock_judge;
59
60/// Removal of a proven stale lock with its companions.
61pub mod stale_ref_lock_retire;
62
63/// The processes that carry a number inside a PID namespace nested in the reader's, which a pid file may name.
64pub mod stale_ref_lock_nested_numbers;
65
66/// The wrapper's own fetch and push, started after the stale reference locks of their repository are cleared.
67pub mod push_lock_clearing;
68
69/// The notice a forwarded fetch or push is preceded by when reference locks of a killed Git are found.
70pub mod forwarded_lock_notice;
71
72/// What the wrapper prints about reference locks, and the quoted command that clears one it will not remove.
73pub mod stale_ref_lock_message;
74
75/// Real Git processes killed with `SIGKILL` while they hold reference locks, for the controls.
76#[cfg(test)]
77pub(crate) mod stale_ref_lock_killed_git;
78
79/// The numbered claim files that let exactly one command work on one worktree or checkout, without a lock.
80#[cfg(target_os = "linux")]
81pub mod single_owner_claim;