git_policy_cli/worktree/mod.rs
1//! What:
2//! Worktree commands:
3//! add,
4//! remove,
5//! clean,
6//! convert,
7//! trash,
8//! snapshots and the placement ladder.
9//! Why:
10//! Worktree lifecycle code shares plans and journals.
11//!
12//! In TS you'd write (pseudocode):
13//! ```ts
14//! // worktree/index.ts: one `export * from './file'` per module below.
15//! ```
16
17/// Whether the checkout of a new worktree may be given Git's parallel checkout, and the option that does it.
18pub mod checkout_workers;
19
20/// Repository and worktree identity as reported by real Git.
21pub mod worktree_identity;
22
23/// The record of where one wrapped `git worktree add` spent its time, step by step,
24/// appended beside the commit timing record.
25pub mod add_timing;
26
27/// Bringing added paths' worktree copies to their landed bytes.
28pub mod worktree_completion;
29
30/// What becomes of the unshown push notices and unfinished pushes of a linked worktree that Git removes.
31pub mod worktree_removal_rescue;
32
33/// The plan for one `git worktree add` that the cheap-worktree ladder serves: its destination and insertion point.
34#[cfg(unix)]
35pub mod worktree_add_plan;
36
37/// The empty subvolume made at the destination of a `git worktree add` before Git runs, and its cleanup.
38#[cfg(target_os = "linux")]
39pub mod worktree_subvolume;
40
41/// Whether a worktree is clean enough to copy from or to remove without asking Git, proven in process.
42#[cfg(target_os = "linux")]
43pub mod worktree_clean;
44
45pub mod worktree_attributes;
46
47pub mod worktree_clean_content;
48
49/// The plan of a `git worktree remove` that names one directory and no option.
50#[cfg(unix)]
51pub mod worktree_remove_plan;
52
53/// The removal of a clean subvolume worktree by one ioctl, and the plan of the `git worktree remove` it serves.
54#[cfg(target_os = "linux")]
55pub mod worktree_remove;
56
57pub mod worktree_remove_registry;
58
59/// Fixtures shared by the controls of the cheap-worktree ladder.
60#[cfg(all(test, target_os = "linux"))]
61pub(crate) mod worktree_ladder_test_support;
62
63/// The snapshot source: whether the creating worktree can be snapshotted for a new worktree, and what that needs.
64#[cfg(target_os = "linux")]
65pub mod worktree_snapshot_source;
66
67/// The snapshot rung's mechanics: snapshot to a stage name, make it a worktree, swap it into place.
68#[cfg(target_os = "linux")]
69pub mod worktree_snapshot;
70
71/// The binding of a `git worktree add` to the directories Git made for it, its record, and the check that the binding holds.
72#[cfg(target_os = "linux")]
73pub mod worktree_add_binding;
74
75/// The clone rung: tracked files cloned into the new worktree, the source's index installed with fresh stat fields.
76#[cfg(target_os = "linux")]
77pub mod worktree_clone;
78
79/// What both filling rungs read from Git's `--no-checkout` result, and the one step that applies the tree difference.
80#[cfg(target_os = "linux")]
81pub mod worktree_ladder_target;
82
83/// The ladder's choice of rung before real Git runs.
84#[cfg(target_os = "linux")]
85pub mod worktree_ladder_run;
86
87/// Where the words of a Git run the wrapper or the service started on its own go, now that none carries `--quiet`.
88pub mod inner_git_words;
89
90/// The plain sentence that says why an add was not made as a snapshot, and where it goes.
91#[cfg(target_os = "linux")]
92pub mod worktree_slow_route;
93
94/// The ladder's steps after real Git returned: the snapshot rung and the fall back to Git's checkout.
95#[cfg(target_os = "linux")]
96pub mod worktree_ladder_finish;
97
98/// The restore of a snapshot of a main checkout with uncommitted changes, and its proof.
99#[cfg(target_os = "linux")]
100pub mod worktree_dirty_restore;
101
102/// The cheap-worktree ladder around one `git worktree add`: what runs before real Git and after it.
103#[cfg(unix)]
104pub mod worktree_ladder;
105
106/// Quoting of bytes printed inside a shell command for a person to run.
107#[cfg(target_os = "linux")]
108pub mod shell_quote;
109
110/// Converting a linked worktree that is an ordinary directory into a btrfs subvolume at the same path, resumably.
111#[cfg(target_os = "linux")]
112pub mod worktree_convert;
113
114/// The read-only comparison of the old tree of a conversion with the installed one.
115#[cfg(target_os = "linux")]
116pub mod worktree_convert_compare;
117
118/// The journal of a conversion and the retirement of the kernel lock file older releases left.
119#[cfg(target_os = "linux")]
120pub mod worktree_convert_journal;
121
122/// The removal of the old tree of a conversion beneath a pinned descriptor.
123#[cfg(target_os = "linux")]
124pub mod worktree_convert_remove;
125
126/// The grammar of `git cli-git convert-worktree-to-subvolume`.
127pub mod worktree_convert_arguments;
128
129/// `git cli-git convert-worktree-to-subvolume`: the worktrees to cover and the report.
130#[cfg(target_os = "linux")]
131pub mod worktree_convert_command;
132
133/// Setting aside what a snapshot of the main checkout leaves out, and having the commit service empty it.
134#[cfg(target_os = "linux")]
135pub mod worktree_trash;
136
137/// Disposal of a snapshot's trash: the work item, the foreground fallback and the service's handler.
138#[cfg(target_os = "linux")]
139pub mod worktree_trash_dispose;
140
141/// The removal of the entries a snapshot's leave-out moved into its trash, side by side.
142#[cfg(target_os = "linux")]
143pub mod worktree_trash_entries;
144
145/// What a snapshot's leave-out made and moved, with identities, as the text a work item carries.
146#[cfg(target_os = "linux")]
147pub mod worktree_trash_manifest;
148
149/// Removal of a directory tree beneath a held parent handle, never following a link.
150#[cfg(target_os = "linux")]
151pub mod worktree_trash_remove;