git_policy_cli/lib.rs
1//! What:
2//! Internal native cli-git implementation,
3//! not yet the production executable.
4//! Why:
5//! The Rust rewrite preserves Git's own argument,
6//! repository and transaction semantics.
7//!
8//! In TS you'd write (pseudocode):
9//! ```ts
10//! // Internal modules used by the forthcoming native entry point and consumer verification.
11//! ```
12//!
13//! Layout:
14//! Every folder below is one subsystem,
15//! and its `mod.rs` declares the modules inside it.
16//! A glob re-export beside each folder keeps the old flat paths (`crate::module_name`) working.
17//! `README.md` ("Source layout") says where a new file belongs.
18
19//region What one command and its policies do
20
21/// What one invocation does from arguments to Git:
22/// the decision,
23/// real Git resolution,
24/// forwarding,
25/// startup and management words.
26pub mod invocation;
27
28/// What:
29/// `pub use invocation::*;` also names every module declared in `invocation/mod.rs` directly under the crate root,
30/// with the visibility each module was declared with.
31/// Why:
32/// The modules moved into folders but keep their paths,
33/// `crate::name` and `git_policy_cli::name`,
34/// so no caller,
35/// fuzz target or test changes and the move stays mechanical.
36/// Gotcha:
37/// A glob re-export is shadowed by a same-named item written in this file,
38/// so no folder may share a name with a module.
39///
40/// In TS you'd write (pseudocode):
41/// ```ts
42/// export * from './invocation';
43/// ```
44pub use invocation::*;
45
46/// Reading and validating `cli-git.config.jsonc` and the Git configuration one invocation is judged by.
47pub mod config;
48
49/// The same re-export for `config`.
50pub use config::*;
51
52/// Per-command handling:
53/// the option grammar of each Git command the wrapper understands,
54/// and the rules that rewrite,
55/// refuse or hint at a command.
56pub mod command;
57
58/// The same re-export for `command`.
59pub use command::*;
60
61/// The policy engine:
62/// the registry,
63/// triggers,
64/// events,
65/// the passes over candidates and direct fixes.
66pub mod policy;
67
68/// The same re-export for `policy`.
69pub use policy::*;
70
71/// The `markdown/autofix` policy and its in-process linter.
72pub mod markdown;
73
74/// The same re-export for `markdown`.
75pub use markdown::*;
76
77/// The dependent-version policy:
78/// manifest and import facts,
79/// the release plan and the policy over them.
80pub mod dependent_version;
81
82/// The same re-export for `dependent_version`.
83pub use dependent_version::*;
84
85/// The standards-review shadow run:
86/// its request,
87/// the patch it covers,
88/// its one HTTPS call and the result it appends.
89pub mod standards_review;
90
91/// The same re-export for `standards_review`.
92pub use standards_review::*;
93
94/// Candidate content:
95/// what a commit or push would add,
96/// read from the index or objects,
97/// and the scanner run over it.
98pub mod candidate;
99
100/// The same re-export for `candidate`.
101pub use candidate::*;
102
103//endregion
104
105//region The commit path and the resident commit service
106
107/// The wrapper's commit path:
108/// arguments,
109/// preparation,
110/// convergence,
111/// conclusion and timing.
112pub mod commit;
113
114/// The same re-export for `commit`.
115pub use commit::*;
116
117/// The shadow repository and the replay of captured changes onto it.
118pub mod shadow;
119
120/// The same re-export for `shadow`.
121pub use shadow::*;
122
123/// Durable transaction state:
124/// owner records,
125/// journal,
126/// phases and recovery.
127pub mod transaction;
128
129/// The same re-export for `transaction`.
130pub use transaction::*;
131
132/// What the commit service does to land a commit:
133/// the serialized step,
134/// the index lock hold,
135/// preparation,
136/// replay and after-commit work.
137pub mod landing;
138
139/// The same re-export for `landing`.
140pub use landing::*;
141
142/// The resident commit service:
143/// protocol,
144/// server,
145/// client,
146/// journal,
147/// provisioning and logging.
148pub mod service;
149
150/// The same re-export for `service`.
151pub use service::*;
152
153//endregion
154
155//region Pushes, merges and conflicts
156
157/// Pushes:
158/// the automatic push after a commit,
159/// manual push handling,
160/// bounded Git queries,
161/// retries and progress watching.
162pub mod push;
163
164/// The same re-export for `push`.
165pub use push::*;
166
167/// Git LFS support:
168/// pre-push planning,
169/// pointer scanning and bounded uploads.
170pub mod lfs;
171
172/// The same re-export for `lfs`.
173pub use lfs::*;
174
175/// Merges:
176/// the word-level second pass,
177/// isolated merges and pull handling.
178pub mod merge;
179
180/// The same re-export for `merge`.
181pub use merge::*;
182
183/// Conflict handling around commits and checkouts:
184/// side flags,
185/// saved copies of conflicted files and leftover markers.
186pub mod conflict;
187
188/// The same re-export for `conflict`.
189pub use conflict::*;
190
191//endregion
192
193//region Worktrees, filesystems and reports
194
195/// Worktree commands:
196/// add,
197/// remove,
198/// clean,
199/// convert,
200/// trash,
201/// snapshots and the placement ladder.
202pub mod worktree;
203
204/// The same re-export for `worktree`.
205pub use worktree::*;
206
207/// Copying the ignored state of a linked worktree into a new one,
208/// with staging,
209/// journal and recovery.
210pub mod worktree_copying;
211
212/// The same re-export for `worktree_copying`.
213pub use worktree_copying::*;
214
215/// Btrfs subvolume worktrees and the filesystem primitives under them.
216pub mod subvolume;
217
218/// The same re-export for `subvolume`.
219pub use subvolume::*;
220
221/// Package-manager and toolchain repair after a worktree is created.
222pub mod repair;
223
224/// The same re-export for `repair`.
225pub use repair::*;
226
227/// The `doctor` report and the checks of hooks and configuration it runs.
228pub mod health;
229
230/// The same re-export for `health`.
231pub use health::*;
232
233//endregion
234
235//region Reading and locking the repository, processes and shared building blocks
236
237/// In-process repository reads:
238/// objects,
239/// packs,
240/// refs,
241/// layout and configuration without starting Git.
242pub mod repo_read;
243
244/// The same re-export for `repo_read`.
245pub use repo_read::*;
246
247/// In-process reading and writing of the Git index file and its extensions.
248pub mod index;
249
250/// The same re-export for `index`.
251pub use index::*;
252
253/// Locks and their owners:
254/// the index lock,
255/// stale reference locks,
256/// and the claims that let one command work on a worktree.
257pub mod lock;
258
259/// The same re-export for `lock`.
260pub use lock::*;
261
262/// Processes:
263/// identities,
264/// trees,
265/// sockets,
266/// signals and quiet-time ledgers.
267pub mod process;
268
269/// The same re-export for `process`.
270pub use process::*;
271
272/// Small shared building blocks:
273/// private files,
274/// scratch locations,
275/// JSON,
276/// time,
277/// random ids,
278/// paths and bounded parallelism.
279pub mod foundation;
280
281/// The same re-export for `foundation`.
282pub use foundation::*;
283
284//endregion
285
286//region Test-only code, never part of the release executable
287
288/// Test-only fixtures shared by many unit tests,
289/// never part of the release executable.
290#[cfg(test)]
291pub mod testing;
292
293/// The same re-export for `testing`.
294#[cfg(test)]
295pub(crate) use testing::*;
296
297/// Controls that read the crate's own source text.
298#[cfg(test)]
299pub mod source_guard;
300
301/// The same re-export for `source_guard`.
302#[cfg(test)]
303pub(crate) use source_guard::*;
304
305//endregion