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/// The decision one invocation ends in:
14/// become Git,
15/// or print and exit.
16pub mod action;
17
18/// Variables added to every real-Git child:
19/// lock PID injection and the forward-target marker.
20pub mod child_environment;
21
22/// The one failure type for rejected configuration content or files.
23pub mod config_error;
24
25/// Repository-root discovery and bounded reading of `cli-git.config.jsonc`.
26pub mod config_file;
27
28/// Lazy configuration loading for known inspection versus mutation/ambiguous commands.
29pub mod config_loading;
30
31/// Whole-document JSONC validation into typed settings.
32pub mod config_parse;
33
34/// Validation of the `policies` section and per-policy options.
35mod config_policies;
36
37/// The `rulesFile` option:
38/// a repository-relative name that stays inside the repository.
39pub mod config_rules_file;
40
41/// Typed settings and their defaults.
42pub mod config_schema;
43
44/// One `git config --list` read, parsed, and the lookups the commit path makes against it.
45pub mod config_snapshot;
46
47/// Key-naming typed readers over parsed JSONC values.
48mod config_values;
49
50/// JSONL event rendering for wrapper-made diagnostics.
51pub mod diagnostics;
52
53/// Worktree target classification for worktree-enforcing policies.
54pub mod effective_target;
55
56/// The per-invocation decision the thin executable performs.
57pub mod entry;
58
59/// Spellings of the wrapper-only escape hatches shared by several modules.
60pub mod escape_hatch;
61
62/// Starting real Git with unchanged arguments,
63/// streams and exit status.
64pub mod forwarding;
65
66/// Captured read-only real-Git queries over raw bytes.
67pub mod git_metadata;
68
69/// Git 2.56.0 global-argument boundaries over unchanged operating-system strings.
70pub mod global_arguments;
71
72/// Configuration of the repository one invocation selects.
73pub mod invocation_config;
74
75/// The `git cli-git` decision:
76/// help,
77/// retired commands,
78/// and direct `check`/`fix`.
79pub mod management;
80
81/// The `git cli-git` argument grammar.
82pub mod management_arguments;
83
84/// The fixed registry of shipped policies.
85pub mod policy_registry;
86
87/// PATH resolution of the real Git executable.
88pub mod real_git;
89
90/// Wrapper self-exclusion for one PATH candidate.
91pub mod real_git_candidate;
92
93/// Disposable fixtures shared by unit tests;
94/// never part of the release executable.
95#[cfg(test)]
96mod test_support;
97
98/// A Git stand-in that logs each start and runs the real Git;
99/// never part of the release executable.
100#[cfg(test)]
101#[cfg(unix)]
102mod recording_git;
103
104/// Repository and worktree identity as reported by real Git.
105pub mod worktree_identity;
106
107/// Git 2.56.0 `parse-options` tokenization of one command's argument region.
108pub mod command_options;
109
110/// Long-option matching:
111/// exact names,
112/// unique abbreviations and `no-` negation.
113mod command_options_long;
114
115/// Final-state and position questions over a tokenized region.
116pub mod command_options_query;
117
118/// Short-option clusters and their attached or following values.
119mod command_options_short;
120
121/// The shared decision of which bytes are an option's value.
122mod command_options_value;
123
124/// Real-Git fixtures and table oracles for command tests;
125/// never in the release build.
126#[cfg(test)]
127mod command_test_support;
128
129/// Differential harness over `git rev-parse --parseopt`;
130/// never in the release build.
131#[cfg(test)]
132mod command_test_parseopt;
133
134/// Table oracle over `--git-completion-helper-all`;
135/// never in the release build.
136#[cfg(test)]
137mod command_test_completion;
138
139/// Facts about the arguments after `git commit`.
140pub mod command_commit;
141
142/// The complete Git 2.56.0 option table of `git commit`.
143pub mod command_commit_table;
144
145/// The shared result and builder of transforms that add tokens to a command line.
146pub mod rule_argument_rewrite;
147
148/// Pure core of the index-against-`HEAD` check.
149pub mod rule_commit_index;
150
151/// The query and reading of "does this worktree hold uncommitted state?".
152pub mod rule_worktree_dirty;
153
154/// Pure decision of the commit-only transform.
155pub mod rule_commit_only;
156
157/// User-facing diagnostics of the commit-only transform.
158pub mod rule_commit_only_message;
159
160/// Pure core of the merge,
161/// cherry-pick and revert conclusion check.
162pub mod rule_commit_sequencer;
163
164/// The Git 2.56.0 option table of `git push` and its facts.
165pub mod command_push;
166
167/// The Git 2.56.0 option table of `git status`,
168/// its facts and the advice-key reading.
169pub mod command_status;
170
171/// Pure decision of the atomic-push transform.
172pub mod rule_atomic_push;
173
174/// Pure decision of the status-hints transform.
175pub mod rule_status_hints;
176
177/// The Git 2.56.0 option table of `git add` and its bulk-staging facts.
178pub mod command_add;
179
180/// The Git 2.56.0 option table of `git clean` and its deletion facts.
181pub mod command_clean;
182
183/// The Git 2.56.0 option table of `git reset` and its mode.
184pub mod command_reset;
185
186/// `git stash` subcommand dispatch and wrapper-flag positions.
187pub mod command_stash;
188
189/// The commands that can overwrite or delete uncommitted state, read as Git reads them.
190pub mod command_discard;
191
192/// The Git 2.56.0 option tables of every `git stash` subcommand.
193pub mod command_stash_table;
194
195/// Branch-creation facts of `git branch`,
196/// `git checkout` and `git switch`.
197pub mod command_branch_create;
198
199/// Which action a tokenized `git branch` region selects.
200mod command_branch_mode;
201
202/// The complete Git 2.56.0 option table of `git branch`.
203pub mod command_branch_table;
204
205/// Explicit creation and the remote-guess candidate of `git checkout` and `git switch`.
206mod command_branch_target;
207
208/// The complete Git 2.56.0 option tables of `git checkout` and `git switch`.
209pub mod command_checkout_table;
210
211/// The Git 2.56.0 option groups of `git config`.
212pub mod command_config_table;
213
214/// The form and file scope of a `git config` region.
215pub mod command_config;
216
217/// Pure decision of the require-root policy.
218pub mod rule_require_root;
219
220/// Whether a `git worktree` invocation creates or moves a worktree.
221pub mod command_worktree;
222
223/// Wrapper-only control spellings,
224/// their meanings,
225/// and removal before the subcommand.
226pub mod wrapper_controls;
227
228/// Removal of every wrapper control from one invocation,
229/// by position.
230pub mod wrapper_invocation;
231
232/// Lifecycle triggers and the trigger set of every shipped policy.
233pub mod policy_trigger;
234
235/// Policy events and their JSON Lines rendering.
236pub mod policy_events;
237
238/// A pathname as events report it:
239/// text,
240/// plus base64 `pathBytes` when it is not UTF-8.
241pub mod event_path;
242
243/// Exact repository path bytes as the operating system takes them, and as text for messages.
244pub mod path_bytes;
245
246/// Ordered policy execution for one lifecycle point.
247pub mod policy_engine;
248
249/// Slice 6: writes one corrected file into the private commit index as a blob and an index entry.
250pub mod private_index_stage;
251
252/// Slice 6: the commit path's bounded policy convergence over the private index.
253pub mod commit_convergence;
254
255/// The commit transaction in the incumbent's order, up to the settled policies.
256pub mod commit_transaction;
257
258/// The conclusion of a settled commit transaction: preparation, landing and post-landing completion.
259pub mod commit_conclusion;
260
261/// The landing loop with replay, revalidation and the starvation reservation.
262pub mod commit_landing_loop;
263
264/// The landing lock a landing attempt takes, with the recovery every acquisition runs first.
265pub mod commit_landing_lock;
266
267/// Revalidation of a replayed tree outside both landing locks.
268pub mod commit_revalidation;
269
270/// The normalization-only transaction for a correction that removed every change.
271pub mod commit_no_change;
272
273/// The finding for a staged deletion that an explicit-path commit cannot record.
274pub mod commit_staged_additions;
275pub mod commit_staged_deletions;
276
277/// The `git commit` command: the transaction, the settled events, the post-commit gate and the backup.
278pub mod commit_command;
279
280/// The disposable, recoverable workspace of one commit transaction.
281pub mod commit_workspace;
282
283/// Rule facts from the real repository with candidates read from the private index.
284pub mod commit_facts;
285
286/// The worktree completion records of selected corrections and of hook changes.
287pub mod commit_worktree_records;
288
289/// The replay-relevant commit options.
290pub mod commit_replay_options;
291
292/// Slice 9 skeleton: the order around a landed commit and a guarded Git child; not reachable until landing is merged.
293pub mod commit_lifecycle;
294
295/// The bounded loop that repeats a pass after corrections changed candidate content.
296pub mod policy_convergence;
297
298/// The one query for repository identity,
299/// top level and the path below it.
300pub mod repository_location;
301
302/// Lazily fetched repository facts behind one interface,
303/// with the real-Git provider.
304pub mod repository_facts;
305
306/// Pure decision of the linked-worktree-only policy.
307pub mod rule_linked_worktree;
308
309/// The rejection texts of the linked-worktree-only policy.
310pub mod rule_linked_worktree_messages;
311
312/// The append-only record of every command form that can discard uncommitted state.
313pub mod discard_audit;
314
315/// The intent-guessing hint that follows a finding, an engine failure or a notice.
316pub mod event_hints;
317
318/// Pure decision of the branch-worktree-only policy and its one-query remote guess.
319pub mod rule_branch_worktree;
320
321/// Pure decision of the add-explicit policy.
322pub mod rule_add_explicit;
323
324/// The repository content the dependent-version planner reads, and its two failure kinds.
325pub mod dependent_version_content;
326
327/// Which paths the dependent-version planner reads: manifests, configuration, source.
328pub mod dependent_version_paths;
329
330/// Strict JSON reading of a manifest's name, version and dependency names.
331pub mod dependent_version_manifest;
332
333/// Patch bumps of plain release versions and `JSON.stringify` quoting.
334pub mod dependent_version_release;
335
336/// The byte-preserving rewrite of a manifest's top-level version.
337pub mod dependent_version_text;
338
339/// Publishable package names from the generated registry configuration.
340pub mod dependent_version_publishable;
341
342/// Whether source text imports a package.
343pub mod dependent_version_imports;
344
345/// The dependency walk and the plan of dependent bumps.
346pub mod dependent_version_graph;
347
348/// Every workspace manifest at both states, and which versions were raised.
349pub mod dependent_version_states;
350
351/// Which development dependencies each dependent bundles.
352pub mod dependent_version_bundled;
353
354/// The dependent-version plan with exact manifest bytes before and after.
355pub mod dependent_version_plan;
356
357/// The decision and findings of `mono/dependent-version-bump`.
358pub mod dependent_version_policy;
359
360/// The dependent-version planner's view of a prepared candidate state.
361pub mod dependent_version_lifecycle;
362
363/// Whether a direct fix may change a tracked file it did not select.
364pub mod policy_added_path;
365
366/// The `mono/dependent-version-bump` check over a lifecycle's candidate state.
367pub mod policy_dependent_version;
368
369/// An in-memory workspace that records reads; never in the release build.
370#[cfg(test)]
371mod dependent_version_test_support;
372
373/// Differential fixture reading and canonical results; never in the release build.
374#[cfg(test)]
375mod dependent_version_fixture_json;
376
377/// Canonical renderings of the native planner's results; never in the release build.
378#[cfg(test)]
379mod dependent_version_fixture_output;
380
381/// One differential case evaluated by the native planner; never in the release build.
382#[cfg(test)]
383mod dependent_version_fixture_cases;
384
385/// The native planner against the incumbent's recorded results; never in the release build.
386#[cfg(test)]
387mod dependent_version_differential_tests;
388
389/// The shipped policies as checks over rule cores and repository facts.
390pub mod policy_checks;
391
392/// What a lifecycle offers content policies,
393/// and its candidates once prepared.
394pub mod policy_content;
395
396/// The built-in final-newline policy:
397/// canonical final LF,
398/// preserved paths,
399/// findings.
400pub mod policy_final_newline;
401
402/// The optional root-context policy:
403/// no top-level `CONTEXT.md` enters the index.
404pub mod policy_root_context;
405
406/// The optional forbidden-strings policy over the linked scanner,
407/// with redacted findings.
408pub mod policy_forbidden_strings;
409
410/// One child program run with a time bound and output caps,
411/// through files instead of pipes.
412pub mod bounded_child;
413
414/// Where the `markdown/autofix` policy finds `monochromatic-lint`:
415/// absolute PATH entries only.
416pub mod markdown_linter_lookup;
417
418/// What one linter run printed:
419/// the fixed source and the findings left,
420/// or why it is unusable.
421pub mod markdown_linter_output;
422
423/// The one-rule linter configuration and the private temporary file it is written to.
424pub mod markdown_linter_config;
425
426/// The gitignore-syntax `exclude` patterns of `markdown/autofix`,
427/// matched as the linter matches them.
428pub mod markdown_exclude;
429
430/// The `markdown/autofix` policy over candidates,
431/// behind its linter interface.
432pub mod policy_markdown;
433
434/// The executable's linter for that policy:
435/// `monochromatic-lint` on PATH,
436/// bounded,
437/// once per candidate.
438pub mod markdown_linter;
439
440/// The executable's panic hook:
441/// where an internal error happened,
442/// never its message.
443pub mod panic_notice;
444
445/// Installing a direct fix's corrections into the worktree,
446/// all or none.
447pub mod direct_fix_install;
448
449/// The direct fix:
450/// converge corrections in memory,
451/// then install them.
452pub mod direct_fix;
453
454/// The fixed argument transforms of a forwarded command,
455/// in order.
456pub mod policy_transforms;
457
458/// One complete pass:
459/// built-in policies,
460/// fixed transforms,
461/// optional policies.
462pub mod policy_pass;
463
464/// The names of the commands built into Git 2.56.0.
465pub mod git_builtins;
466
467/// The work of the installed cli-git that is not ported,
468/// and the refusal notice.
469pub mod unported;
470
471/// The lifecycle of one wrapped Git command,
472/// from refusals to forwarding.
473pub mod wrapped_command;
474
475/// A scripted repository-facts provider for unit tests;
476/// never in the release build.
477#[cfg(test)]
478mod policy_test_support;
479
480/// The one failure type of the candidate layer and its closed list of causes.
481pub mod candidate_error;
482
483/// Validated Git object names and the file modes a candidate can carry.
484pub mod candidate_object;
485
486/// Pure framing of one `git cat-file --batch` reply.
487pub mod candidate_batch;
488
489/// Pure parsing of raw NUL-delimited changed-path records.
490pub mod candidate_record;
491
492/// The long-lived object reader that answers every blob read of an invocation.
493pub mod candidate_reader;
494
495/// Immutable candidate versions:
496/// identity,
497/// pathname,
498/// mode,
499/// change and object per path.
500pub mod candidate_version;
501
502/// Per-invocation listing,
503/// lazy bytes and invalidation of candidate versions.
504pub mod candidate_store;
505
506/// Pure parsing of `git ls-files --stage` records and the delta between two index states.
507pub mod candidate_stage;
508
509/// The files of a commit's tree with their modes and objects.
510pub mod candidate_tree;
511
512/// A private,
513/// timestamp-preserving copy of the real index,
514/// removed when dropped.
515pub mod candidate_private_index;
516
517/// Which candidate paths have their `text` Git attribute unset,
518/// read from the state the candidates were listed from.
519pub mod candidate_attribute;
520
521/// What `git add` would stage,
522/// and the worktree files a direct command selects.
523pub mod candidate_prediction;
524
525/// Which candidates hold content that a parent commit's tree already holds,
526/// found by exact object name.
527pub mod candidate_known_content;
528
529/// The linked forbidden-strings scanner:
530/// one load per invocation,
531/// typed redacted findings.
532pub mod scanner_adapter;
533
534/// Rules-file precedence and which candidates the scanner is given.
535pub mod scanner_selection;
536
537/// One scan pass over a candidate version's exact bytes.
538pub mod scanner_run;
539
540/// Which engine failure code each candidate and scanner failure carries.
541pub mod scanner_failure_code;
542
543/// Process isolation and rule fixtures for scanner controls;
544/// never in the release build.
545#[cfg(test)]
546mod scanner_test_support;
547
548/// Private,
549/// crash-safe file primitives shared by every durable record.
550pub mod private_storage;
551
552/// Where short-lived private files live:
553/// the per-user scratch directory and the repository scratch directory,
554/// never the system temporary directory.
555pub mod scratch_location;
556
557/// Compact JSON records read and written with the incumbent's `JSON` semantics.
558pub mod json_record;
559
560/// Random identifiers in the layout of the incumbent's `randomUUID`.
561pub mod random_id;
562
563/// Text operations with the exact semantics of JavaScript's built-ins.
564pub mod js_text;
565
566/// The PID namespace an owner record names, and the rule for owners of another one.
567pub mod pid_namespace;
568
569/// Process-birth identities in the incumbent's exact spelling.
570pub mod process_identity;
571
572/// The owner record inside every owner-lock directory.
573pub mod owner_lock_record;
574
575/// Rename-published owner locks with dead-owner retirement and an unbounded wait.
576pub mod owner_lock;
577
578/// Line-oriented debug and warning diagnostics on standard error.
579pub mod diagnostic_log;
580
581/// The fail-closed failure of reading or recovering durable transaction state.
582pub mod recovery_error;
583
584/// The owner record of one commit-transaction directory and its liveness rule.
585pub mod transaction_owner;
586
587/// The per-worktree registry of commit-transaction directories.
588pub mod transaction_registry;
589
590/// The length and hash of an index snapshot that a landing record keeps.
591pub mod content_digest;
592
593/// The schema-version-2 journal records of one commit transaction and their filenames.
594pub mod transaction_journal;
595
596/// The exact encoding of every journal record.
597pub mod transaction_journal_encode;
598
599/// Strict parsers of every journal record.
600pub mod transaction_journal_parse;
601
602/// UTC timestamps in the exact form of JavaScript's `toISOString`.
603pub mod iso_time;
604
605/// The filesystem identity recorded with every real `index.lock` a transaction creates.
606pub mod filesystem_identity;
607
608/// The Linux filesystem UUID of a path read from the mount table and the udev database instead of `findmnt`.
609#[cfg(target_os = "linux")]
610pub mod filesystem_identity_mount;
611
612/// Running real Git for transaction,
613/// recovery and landing work.
614pub mod transaction_git;
615
616/// The preparation and landing leases nested wrapper invocations inherit.
617pub mod transaction_lease;
618
619/// The dispatch plan of one commit transaction, its JSON spelling and the config reads it makes.
620pub mod hook_dispatch_plan;
621
622/// The hooks directory of one transaction: its plan and one entry per preparation event.
623pub mod hook_dispatch_entries;
624
625/// The hook dispatcher entered by a transaction's hook entry name, under the hook lock.
626pub mod hook_dispatch;
627
628/// The non-blocking warning for a configured `core.hooksPath`, decided from the configuration snapshot alone.
629pub mod traditional_hook_warning;
630
631/// `git cli-git doctor`: the traditional hooks a repository holds, which are unsupported.
632pub mod doctor;
633
634/// The Git LFS upload before a push, as a configuration hook the wrapper puts in effect for its own pushes.
635pub mod lfs_pre_push;
636
637/// Every real-Git start of the wrapper carries `core.hooksPath` pointing at a directory that never exists.
638pub mod hooks_off;
639
640/// No-follow file operations recovery and landing share.
641pub mod recovery_files;
642
643/// Durable evidence a dead transaction left:
644/// attempt records,
645/// owned locks and Git's PID file.
646pub mod recovery_evidence;
647
648/// The reflog search that proves which commit an interrupted transaction landed.
649pub mod recovery_reflog;
650
651/// Deciding whether a landing landed,
652/// and installing its recorded post-index.
653pub mod recovery_completion;
654
655/// The check that an index snapshot still holds the bytes the landing wrote.
656pub mod recovery_snapshot;
657
658/// The steps that finish a retained transaction by hand.
659pub mod recovery_manual_steps;
660
661/// The failure of a journal record that cannot be read, with its path and ways out named.
662pub mod recovery_record_failure;
663
664/// The refusal to discard a transaction whose branch moved but whose records say otherwise.
665pub mod recovery_contradiction;
666
667/// The `.keep` files protecting a landing's migrated pack.
668pub mod pack_keep;
669
670/// Test-only transaction phase markers, compiled into the release executable and armed only by an environment variable.
671pub mod transaction_phase;
672
673/// Landing target comparison, nonce reflog message and compare-and-swap.
674pub mod landing_support;
675
676/// Migration of a prepared commit's shadow objects into a kept pack of the real store.
677pub mod landing_objects;
678
679/// Post-index a landing installs, computed against the real index at landing.
680pub mod landing_index;
681
682/// The check that a landing changed no staged entry outside the paths it committed.
683pub mod landing_invariant;
684
685/// One landing attempt inside the landing critical section, and its outcome.
686pub mod landing_attempt;
687
688/// The `concurrent-commit` finding for a landing that landed nothing.
689pub mod landing_findings;
690
691/// Git commands run against a transaction's shadow repository.
692pub mod shadow_git;
693
694/// Native conclusion cleanup reproduced in the owning worktree.
695pub mod conclusion_cleanup;
696
697/// The per-worktree capture store:
698/// location,
699/// sequence and identity.
700pub mod capture_store;
701
702/// `captured.json`,
703/// landed-capture records,
704/// their recording and pruning.
705pub mod capture_records;
706
707/// Replay: the unified-diff parser of subsumption (`replay_patch`).
708pub mod replay_patch;
709
710/// Replay: the exact strict reverse check of subsumption (`replay_reverse_apply`).
711pub mod replay_reverse_apply;
712
713/// Replay: the one-sided extension of subsumption over zero-context hunks (`replay_containment`).
714pub mod replay_containment;
715
716/// Replay: raw commit objects as bytes, the unsigned rewrite and signed-rebuild inputs (`replay_object`).
717pub mod replay_object;
718
719/// Replay: capture order over the landed first-parent history and the per-path decision (`replay_capture_order`).
720pub mod replay_capture_order;
721
722/// Replay: the starvation reservation of the next landing slot (`replay_reservation`).
723pub mod replay_reservation;
724
725/// Replay: the shadow-repository Git runner that every replay step uses (`replay_shadow`).
726pub mod replay_shadow;
727
728/// Replay: shared paths of the landed history and the prepared commit, with their three entries (`replay_shared_paths`).
729pub mod replay_shared_paths;
730
731/// Replay: the text half of subsumption over index-named blobs and hunks (`replay_subsumption_text`).
732pub mod replay_subsumption_text;
733
734/// Replay: subsumption rules and the synthetic merge base (`replay_subsumption`).
735pub mod replay_subsumption;
736
737/// Replay: capture-order history and the per-path decisions from the transaction's and landed records (`replay_capture_history`).
738pub mod replay_capture_history;
739
740/// Replay: the merge tree, the first conflicting landed commit, and the replayed commit rebuild (`replay_merge`).
741pub mod replay_merge;
742
743/// Replay: the replayed index, the shadow HEAD move, and the pre-commit re-run decision of revalidation (`replay_revalidation`).
744pub mod replay_revalidation;
745
746/// Replay: one replay of a prepared commit onto a moved target, the integrator's replay result (`replay_commit`).
747pub mod replay_commit;
748/// The empty tree's object name under each known object format.
749pub mod empty_tree;
750
751/// Files-backend ref reads that answer without a Git process or decline.
752pub mod ref_files;
753
754/// Proof, without a Git process, that a sequencer marker names nothing on the files ref storage.
755pub mod sequencer_marker;
756
757/// The invocation capture:
758/// repository layout, symbolic `HEAD`, conclusion kind, ref backend and base.
759pub mod capture_invocation;
760
761/// The capture under capture order:
762/// the capture lock, the store identity, the sequence and `captured.json`.
763pub mod capture_order;
764
765/// The shadow repository `config` file and the copied repository format.
766pub mod shadow_config;
767
768/// The shadow repository links to the real shared entries.
769pub mod shadow_links;
770
771/// The shadow ref store: snapshot, private target, symbolic refs and `HEAD`.
772pub mod shadow_refs;
773
774/// The shadow conclusion copies at preparation.
775pub mod conclusion_copy;
776
777/// Argument transforms of native preparation: normalisation, global split, `-a` removal and private arguments.
778pub mod commit_args;
779
780/// The private commit index: copies, selection modes, pathspec files and listings.
781pub mod commit_index;
782
783/// Native `git commit` in the shadow, the prepared commit read back and `prepared.json`.
784pub mod commit_preparation;
785
786/// Creation of the shadow repository of one transaction.
787pub mod shadow_create;
788
789/// Loading many blobs through one `git cat-file --batch`.
790pub mod blob_batch;
791
792/// Bringing added paths' worktree copies to their landed bytes.
793pub mod worktree_completion;
794
795/// Owner inspection of registry entries and the oldest-first order.
796pub mod recovery_inspect;
797
798/// Recovery of one dead-owner transaction.
799pub mod recovery_landing;
800
801/// Disposal of a landed transaction: shadow removal, directory removal, then landed-capture pruning.
802pub mod landed_disposal;
803
804/// The post-commit run after a landing: author environment, hook lock, and the hook runner with inherited streams.
805pub mod post_commit_hook;
806
807/// Post-landing completion of one landed commit: worktree copies, disposal, maintenance, then `post-commit`.
808pub mod post_landing;
809
810/// Recovery across every transaction directory of one worktree.
811pub mod recovery_scan;
812
813/// Startup recovery of interrupted commit transactions.
814pub mod commit_recovery;
815
816/// Startup recovery as a step of a wrapped or direct command.
817pub mod transaction_gate;
818
819/// Process start times for lock owners,
820/// read from `/proc`,
821/// `ps` or the Windows process table.
822pub mod process_start;
823
824/// The Git version check run once before work that depends on Git's behavior.
825pub mod git_version;
826
827/// The private per-user cache of the version text, keyed by the Git executable's identity.
828pub mod git_version_cache;
829
830/// Processes holding a lock file open,
831/// found by device and inode.
832pub mod index_lock_holders;
833
834/// Parsers of `lsof -F pcDi` records and Restart Manager lines,
835/// matched by device and inode.
836pub mod index_lock_holder_parsers;
837
838/// Evidence about a foreign `index.lock` and the verdict it supports.
839pub mod index_lock_evidence;
840
841/// The Git command a forwarded invocation runs,
842/// after ordinary alias expansion.
843pub mod forwarded_command;
844
845/// Index-writer classification and the commands that coordinate with a landing.
846pub mod index_writer_commands;
847
848/// Waiting for a foreign index.lock under the classification rules and Git's backoff schedule.
849pub mod index_lock_wait;
850
851/// The host side effects of the index-lock wait:
852/// /proc reads,
853/// sleeps,
854/// randomness and standard error.
855pub mod index_lock_wait_host;
856
857/// The landing location a forwarded index writer coordinates with:
858/// the real index and the registry.
859pub mod landing_location;
860
861/// Coordination of a forwarded index writer:
862/// the landing lock,
863/// the wait for a foreign lock and the lease.
864pub mod index_writer_coordination;
865
866/// Running a coordinated forwarded index writer:
867/// the landing lock held while real Git runs as a child.
868pub mod index_writer_forward;
869
870/// The `git merge` command lines the wrapper completes in isolation, and those it leaves to native Git.
871pub mod merge_options;
872
873/// The durable intent record of an isolated merge.
874pub mod merge_isolation_journal;
875
876/// The raw differences of an isolated merge and the worktree state of each changed path.
877pub mod merge_isolation_changes;
878
879/// Recovery of an isolated merge whose process died.
880pub mod merge_isolation_recovery;
881
882/// The commit message of an isolated merge.
883pub mod merge_isolation_message;
884
885/// The refusal findings of an isolated merge.
886pub mod merge_isolation_report;
887
888/// A true merge completed in isolation while the index holds staged changes.
889pub mod merge_isolation;
890
891/// The real index.lock a landing creates,
892/// identifies and releases only while it is the same file.
893pub mod real_index_lock;
894/// Automatic maintenance decision: config record parsing and the enable and detach rules.
895pub mod maintenance_decision;
896
897/// Running automatic maintenance after a landing: the config read, then `git maintenance run --auto`.
898pub mod maintenance_run;
899
900/// Catching SIGINT, SIGTERM, SIGHUP and SIGQUIT while a Git child runs, and relaying only process-sent signals.
901pub mod signal_relay;
902
903/// Exact removal of retired hk hook registrations from one explicit Git configuration scope.
904pub mod maintenance_hk_config;
905
906/// The per-branch push coordination file name: a reversible, flat, case-safe key.
907pub mod auto_push_branch_key;
908
909/// The per-branch `last-pushed` record: validation, tolerant reads and atomic publication.
910pub mod auto_push_record;
911
912/// Waiting for a lock a live process holds: a slow-wait notice naming the holder and a configurable backstop.
913pub mod live_lock;
914
915/// The shared clock of every wait notice: the grace, the repeat interval and a queued commit's place in line.
916pub mod wait_progress;
917
918/// A watcher for waits that block on a child process: notices at the cadence and the child stopped at the bound.
919pub mod child_watch;
920
921/// Read-only Git queries of the auto-push, each with a deadline and separate output streams.
922pub mod bounded_query;
923
924/// The auto-push's real `git push` with a deadline, its low-speed abort and the lock wait limit derived from it.
925pub mod bounded_push;
926
927/// Single-flight push coordination per branch: owner lock, record joins and the push itself.
928pub mod auto_push_single_flight;
929
930/// Publishing a landed commit that a moved remote branch rejected: the merge is made from objects alone and pushed.
931pub mod auto_push_reconcile;
932
933/// The paths of a dirty worktree and of a fast-forward, and their overlap.
934pub mod auto_push_dirty_paths;
935
936/// Post-commit auto-push of a landed commit: the push argv, the surfaced output and the failure reporting.
937pub mod auto_push;
938
939/// The post-commit gate over a landed commit: its events, its blocking and the backup it allows.
940pub mod post_commit;
941
942/// Authoritative manual-push updates discovered by a private dry-run push and confirmed with ls-remote.
943pub mod manual_push_probe;
944
945/// Published-set and range computation for manual-push scans: which pushed commits a remote does not have.
946pub mod manual_push_range;
947
948/// An explicit push that lost a race: run as a child, merge in what landed on the remote and publish the merge.
949pub mod push_stacking;
950
951/// Starting a child again when the operating system refuses it for lack of processes, within a bounded wait.
952pub mod start_retry;
953
954/// The manual-push candidate scope of one push: the commits and trees the destination lacks.
955pub mod manual_push_lifecycle;
956/// The one failure type of the linked-worktree ignored-state copy and its diagnostics.
957pub mod worktree_copy_error;
958
959/// Which linked worktrees a worktree-creating Git command registered, before and after it ran.
960pub mod worktree_copy_registry;
961
962/// The ignored source paths a linked-worktree copy selects, and the path validation every selection passes.
963pub mod worktree_copy_selection;
964
965/// The deterministic parent-first manifest of a copy, and the mode application to a staged copy.
966pub mod worktree_copy_manifest;
967
968/// Exact comparison of manifest entries against the filesystem, and the source stability check after staging.
969pub mod worktree_copy_compare;
970
971/// The private, validated stage of one source's ignored state beside a destination worktree.
972pub mod worktree_copy_stage;
973
974/// The exclusive creation of one destination entry from the stage, and the identity captured after it.
975#[cfg(unix)]
976pub mod worktree_copy_install_entry;
977
978/// Installation of a validated stage into a new worktree, with preflight, batches and rollback on failure.
979#[cfg(unix)]
980pub mod worktree_copy_install;
981
982/// Removal of the paths a failed installation created, only where their identity and content still prove them cli-git's own.
983#[cfg(unix)]
984pub mod worktree_copy_rollback;
985
986/// The durable journal of one copy: exact encoding, strict validation, private storage and removal.
987#[cfg(unix)]
988pub mod worktree_copy_journal;
989
990/// The durable claim on a stage container's name, and the removal of stages an interrupted copy left behind.
991#[cfg(unix)]
992pub mod worktree_copy_stage_claim;
993
994/// The append-only install log of one stage: per-batch intents and creations, with resumption.
995#[cfg(unix)]
996pub mod worktree_copy_install_log;
997
998/// One journaled installation to an end, resumption from the log, and synchronization of a created worktree.
999#[cfg(unix)]
1000pub mod worktree_copy_transaction;
1001
1002/// The settlement lock that serializes copy installation and recovery, its owner record, and inherited leases.
1003#[cfg(unix)]
1004pub mod worktree_copy_lock;
1005
1006/// Recovery of interrupted copies: registration checks, discards with notices, resumption, and the pending check.
1007#[cfg(unix)]
1008pub mod worktree_copy_recovery;
1009
1010/// The linked-worktree ignored-state copy around one forwarded Git invocation: the integrator's entry point.
1011#[cfg(unix)]
1012pub mod worktree_copy;
1013
1014/// Which forwarded invocations the copy applies to, and the child run that carries its settlement lease.
1015pub mod worktree_copy_forward;