Skip to main content

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/// The four top-level spellings after which the wrapper announces itself,
19///  and the text it prints once Git has answered.
20pub mod announced_query;
21
22/// Variables added to every real-Git child:
23///  lock PID injection and the forward-target marker.
24pub mod child_environment;
25
26/// The one failure type for rejected configuration content or files.
27pub mod config_error;
28
29/// Repository-root discovery and bounded reading of `cli-git.config.jsonc`.
30pub mod config_file;
31
32/// Lazy configuration loading for known inspection versus mutation/ambiguous commands.
33pub mod config_loading;
34
35/// Whole-document JSONC validation into typed settings.
36pub mod config_parse;
37
38/// Validation of the `policies` section and per-policy options.
39mod config_policies;
40
41/// The `rulesFile` option:
42///  a repository-relative name that stays inside the repository.
43pub mod config_rules_file;
44
45/// Typed settings and their defaults.
46pub mod config_schema;
47
48/// One `git config --list` read, parsed, and the lookups the commit path makes against it.
49pub mod config_snapshot;
50
51/// Key-naming typed readers over parsed JSONC values.
52mod config_values;
53
54/// JSONL event rendering for wrapper-made diagnostics.
55pub mod diagnostics;
56
57/// Worktree target classification for worktree-enforcing policies.
58pub mod effective_target;
59
60/// The per-invocation decision the thin executable performs.
61pub mod entry;
62
63/// Spellings of the wrapper-only escape hatches shared by several modules.
64pub mod escape_hatch;
65
66/// Starting real Git with unchanged arguments,
67///  streams and exit status.
68pub mod forwarding;
69
70/// Captured read-only real-Git queries over raw bytes.
71pub mod git_metadata;
72
73/// Git 2.56.0 global-argument boundaries over unchanged operating-system strings.
74pub mod global_arguments;
75
76/// Configuration of the repository one invocation selects.
77pub mod invocation_config;
78
79/// The `git cli-git` decision:
80///  help,
81///  retired commands,
82///  and direct `check`/`fix`.
83pub mod management;
84
85/// The `git cli-git` argument grammar.
86pub mod management_arguments;
87
88/// The refusal of a direct command whose `--policy` selects a policy that is off.
89pub mod management_selection;
90
91/// The fixed registry of shipped policies.
92pub mod policy_registry;
93
94/// PATH resolution of the real Git executable.
95pub mod real_git;
96
97/// Wrapper self-exclusion for one PATH candidate.
98pub mod real_git_candidate;
99
100/// Disposable fixtures shared by unit tests;
101///  never part of the release executable.
102#[cfg(test)]
103mod test_support;
104
105/// A Git stand-in that logs each start and runs the real Git;
106///  never part of the release executable.
107#[cfg(test)]
108#[cfg(unix)]
109mod recording_git;
110
111/// Repository and worktree identity as reported by real Git.
112pub mod worktree_identity;
113
114/// Git 2.56.0 `parse-options` tokenization of one command's argument region.
115pub mod command_options;
116
117/// Long-option matching:
118///  exact names,
119///  unique abbreviations and `no-` negation.
120mod command_options_long;
121
122/// Final-state and position questions over a tokenized region.
123pub mod command_options_query;
124
125/// Short-option clusters and their attached or following values.
126mod command_options_short;
127
128/// The shared decision of which bytes are an option's value.
129mod command_options_value;
130
131/// Real-Git fixtures and table oracles for command tests;
132///  never in the release build.
133#[cfg(test)]
134mod command_test_support;
135
136/// Per-case copies of a pristine fixture and worker threads for independent test cases;
137///  never in the release build.
138#[cfg(test)]
139mod command_test_cases;
140
141/// Differential harness over `git rev-parse --parseopt`;
142///  never in the release build.
143#[cfg(test)]
144mod command_test_parseopt;
145
146/// Table oracle over `--git-completion-helper-all`;
147///  never in the release build.
148#[cfg(test)]
149mod command_test_completion;
150
151/// Facts about the arguments after `git commit`.
152pub mod command_commit;
153
154/// The complete Git 2.56.0 option table of `git commit`.
155pub mod command_commit_table;
156
157/// The shared result and builder of transforms that add tokens to a command line.
158pub mod rule_argument_rewrite;
159
160/// Pure core of the index-against-`HEAD` check.
161pub mod rule_commit_index;
162
163/// The query and reading of "does this worktree hold uncommitted state?".
164pub mod rule_worktree_dirty;
165
166/// Pure decision of the commit-only transform.
167pub mod rule_commit_only;
168
169/// User-facing diagnostics of the commit-only transform.
170pub mod rule_commit_only_message;
171
172/// Pure core of the merge,
173///  cherry-pick and revert conclusion check.
174pub mod rule_commit_sequencer;
175
176/// The Git 2.56.0 option table of `git push` and its facts.
177pub mod command_push;
178
179/// The Git 2.56.0 option table of `git status`,
180///  its facts and the advice-key reading.
181pub mod command_status;
182
183/// Pure decision of the atomic-push transform.
184pub mod rule_atomic_push;
185
186/// Pure decision of the status-hints transform.
187pub mod rule_status_hints;
188
189/// The Git 2.56.0 option table of `git add` and its bulk-staging facts.
190pub mod command_add;
191
192/// The Git 2.56.0 option table of `git clean` and its deletion facts.
193pub mod command_clean;
194
195/// The Git 2.56.0 option table of `git reset` and its mode.
196pub mod command_reset;
197
198/// `git stash` subcommand dispatch and wrapper-flag positions.
199pub mod command_stash;
200
201/// The commands that can overwrite or delete uncommitted state, read as Git reads them.
202pub mod command_discard;
203
204/// The Git 2.56.0 option tables of every `git stash` subcommand.
205pub mod command_stash_table;
206
207/// Branch-creation facts of `git branch`,
208///  `git checkout` and `git switch`.
209pub mod command_branch_create;
210
211/// Which action a tokenized `git branch` region selects.
212mod command_branch_mode;
213
214/// The complete Git 2.56.0 option table of `git branch`.
215pub mod command_branch_table;
216
217/// Explicit creation and the remote-guess candidate of `git checkout` and `git switch`.
218mod command_branch_target;
219
220/// The complete Git 2.56.0 option tables of `git checkout` and `git switch`.
221pub mod command_checkout_table;
222
223/// The Git 2.56.0 option groups of `git config`.
224pub mod command_config_table;
225
226/// The form and file scope of a `git config` region.
227pub mod command_config;
228
229/// Pure decision of the require-root policy.
230pub mod rule_require_root;
231
232/// Whether a `git worktree` invocation creates or moves a worktree.
233pub mod command_worktree;
234
235/// Wrapper-only control spellings,
236///  their meanings,
237///  and removal before the subcommand.
238pub mod wrapper_controls;
239
240/// Removal of every wrapper control from one invocation,
241///  by position.
242pub mod wrapper_invocation;
243
244/// Lifecycle triggers and the trigger set of every shipped policy.
245pub mod policy_trigger;
246
247/// Policy events and their JSON Lines rendering.
248pub mod policy_events;
249
250/// A pathname as events report it:
251///  text,
252///  plus base64 `pathBytes` when it is not UTF-8.
253pub mod event_path;
254
255/// Exact repository path bytes as the operating system takes them, and as text for messages.
256pub mod path_bytes;
257
258/// Ordered policy execution for one lifecycle point.
259pub mod policy_engine;
260
261/// Slice 6: writes one corrected file into the private commit index as a blob and an index entry.
262pub mod private_index_stage;
263
264/// Slice 6: the commit path's bounded policy convergence over the private index.
265pub mod commit_convergence;
266
267/// The commit transaction in the incumbent's order, up to the settled policies.
268pub mod commit_transaction;
269
270/// The conclusion of a settled commit transaction: preparation, landing and post-landing completion.
271pub mod commit_conclusion;
272
273/// The normalization-only transaction for a correction that removed every change.
274pub mod commit_no_change;
275
276/// The finding for a staged deletion that an explicit-path commit cannot record.
277pub mod commit_staged_additions;
278pub mod commit_staged_deletions;
279
280/// The `git commit` command: the transaction, the settled events, the post-commit gate and the backup.
281pub mod commit_command;
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 bounded loop that repeats a pass after corrections changed candidate content.
290pub mod policy_convergence;
291
292/// The one query for repository identity,
293///  top level and the path below it.
294pub mod repository_location;
295
296/// Lazily fetched repository facts behind one interface,
297///  with the real-Git provider.
298pub mod repository_facts;
299
300/// Pure decision of the linked-worktree-only policy.
301pub mod rule_linked_worktree;
302
303/// The rejection texts of the linked-worktree-only policy.
304pub mod rule_linked_worktree_messages;
305
306/// The append-only record of every command form that can discard uncommitted state.
307pub mod discard_audit;
308
309/// The intent-guessing hint that follows a finding, an engine failure or a notice.
310pub mod event_hints;
311
312/// Pure decision of the branch-worktree-only policy and its one-query remote guess.
313pub mod rule_branch_worktree;
314
315/// Pure decision of the add-explicit policy.
316pub mod rule_add_explicit;
317
318/// The repository content the dependent-version planner reads, and its two failure kinds.
319pub mod dependent_version_content;
320
321/// Which paths the dependent-version planner reads: manifests, configuration, source.
322pub mod dependent_version_paths;
323
324/// Strict JSON reading of a manifest's name, version and dependency names.
325pub mod dependent_version_manifest;
326
327/// Patch bumps of plain release versions and `JSON.stringify` quoting.
328pub mod dependent_version_release;
329
330/// The byte-preserving rewrite of a manifest's top-level version.
331pub mod dependent_version_text;
332
333/// Publishable package names from the generated registry configuration.
334pub mod dependent_version_publishable;
335
336/// Whether source text imports a package.
337pub mod dependent_version_imports;
338
339/// The dependency walk and the plan of dependent bumps.
340pub mod dependent_version_graph;
341
342/// Every workspace manifest at both states, and which versions were raised.
343pub mod dependent_version_states;
344
345/// Which development dependencies each dependent bundles.
346pub mod dependent_version_bundled;
347
348/// The dependent-version plan with exact manifest bytes before and after.
349pub mod dependent_version_plan;
350
351/// The decision and findings of `mono/dependent-version-bump`.
352pub mod dependent_version_policy;
353
354/// The dependent-version planner's view of a prepared candidate state.
355pub mod dependent_version_lifecycle;
356
357/// Whether a direct fix may change a tracked file it did not select.
358pub mod policy_added_path;
359
360/// The `mono/dependent-version-bump` check over a lifecycle's candidate state.
361pub mod policy_dependent_version;
362
363/// An in-memory workspace that records reads; never in the release build.
364#[cfg(test)]
365mod dependent_version_test_support;
366
367/// Differential fixture reading and canonical results; never in the release build.
368#[cfg(test)]
369mod dependent_version_fixture_json;
370
371/// Canonical renderings of the native planner's results; never in the release build.
372#[cfg(test)]
373mod dependent_version_fixture_output;
374
375/// One differential case evaluated by the native planner; never in the release build.
376#[cfg(test)]
377mod dependent_version_fixture_cases;
378
379/// The native planner against the incumbent's recorded results; never in the release build.
380#[cfg(test)]
381mod dependent_version_differential_tests;
382
383/// The shipped policies as checks over rule cores and repository facts.
384pub mod policy_checks;
385
386/// What a lifecycle offers content policies,
387///  and its candidates once prepared.
388pub mod policy_content;
389
390/// The built-in final-newline policy:
391///  canonical final LF,
392///  preserved paths,
393///  findings.
394pub mod policy_final_newline;
395
396/// The optional root-context policy:
397///  no top-level `CONTEXT.md` enters the index.
398pub mod policy_root_context;
399
400/// The optional catalog-specifier policy over the shared rule crate:
401///  every dependency in a tracked `package.json` is a catalog or workspace reference.
402pub mod policy_catalog_specifiers;
403
404/// The optional forbidden-strings policy over the linked scanner,
405///  with redacted findings.
406pub mod policy_forbidden_strings;
407
408/// One child program run with a time bound and output caps,
409///  through files instead of pipes.
410pub mod bounded_child;
411
412/// What one in-process linter run produced:
413///  the fixed source and the findings left,
414///  or why it is unusable.
415pub mod markdown_linter_output;
416
417/// The one-rule linter configuration document.
418pub mod markdown_linter_config;
419
420/// The gitignore-syntax `exclude` patterns of `markdown/autofix`,
421///  matched as the linter matches them.
422pub mod markdown_exclude;
423
424/// The `markdown/autofix` policy over candidates,
425///  behind its linter interface.
426pub mod policy_markdown;
427
428/// The executable's linter for that policy:
429///  `monochromatic-lint` linked in-process,
430///  guarded by a deadline,
431///  once per candidate.
432pub mod markdown_linter;
433
434/// A job on a thread of its own with a deadline and panic containment.
435pub mod markdown_linter_guard;
436
437/// The executable's panic hook:
438///  where an internal error happened,
439///  never its message.
440pub mod panic_notice;
441
442/// Installing a direct fix's corrections into the worktree,
443///  all or none.
444pub mod direct_fix_install;
445
446/// The direct fix:
447///  converge corrections in memory,
448///  then install them.
449pub mod direct_fix;
450
451/// The fixed argument transforms of a forwarded command,
452///  in order.
453pub mod policy_transforms;
454
455/// One complete pass:
456///  built-in policies,
457///  fixed transforms,
458///  optional policies.
459pub mod policy_pass;
460
461/// The names of the commands built into Git 2.56.0.
462pub mod git_builtins;
463
464/// The work of the installed cli-git that is not ported,
465///  and the refusal notice.
466pub mod unported;
467
468/// The lifecycle of one wrapped Git command,
469///  from refusals to forwarding.
470pub mod wrapped_command;
471
472/// A scripted repository-facts provider for unit tests;
473///  never in the release build.
474#[cfg(test)]
475mod policy_test_support;
476
477/// The one failure type of the candidate layer and its closed list of causes.
478pub mod candidate_error;
479
480/// Validated Git object names and the file modes a candidate can carry.
481pub mod candidate_object;
482
483/// Pure framing of one `git cat-file --batch` reply.
484pub mod candidate_batch;
485
486/// Pure parsing of raw NUL-delimited changed-path records.
487pub mod candidate_record;
488
489/// The long-lived object reader that answers every blob read of an invocation.
490pub mod candidate_reader;
491
492/// Immutable candidate versions:
493///  identity,
494///  pathname,
495///  mode,
496///  change and object per path.
497pub mod candidate_version;
498
499/// Per-invocation listing,
500///  lazy bytes and invalidation of candidate versions.
501pub mod candidate_store;
502
503/// Pure parsing of `git ls-files --stage` records and the delta between two index states.
504pub mod candidate_stage;
505
506/// The files of a commit's tree with their modes and objects.
507pub mod candidate_tree;
508
509/// A private,
510///  timestamp-preserving copy of the real index,
511///  removed when dropped.
512pub mod candidate_private_index;
513
514/// Which candidate paths have their `text` Git attribute unset,
515///  read from the state the candidates were listed from.
516pub mod candidate_attribute;
517
518/// What `git add` would stage,
519///  and the worktree files a direct command selects.
520pub mod candidate_prediction;
521
522/// Which candidates hold content that a parent commit's tree already holds,
523///  found by exact object name.
524pub mod candidate_known_content;
525
526/// The linked forbidden-strings scanner:
527///  one load per invocation,
528///  typed redacted findings.
529pub mod scanner_adapter;
530
531/// Rules-file precedence and which candidates the scanner is given.
532pub mod scanner_selection;
533
534/// One scan pass over a candidate version's exact bytes.
535pub mod scanner_run;
536
537/// Which engine failure code each candidate and scanner failure carries.
538pub mod scanner_failure_code;
539
540/// Process isolation and rule fixtures for scanner controls;
541///  never in the release build.
542#[cfg(test)]
543mod scanner_test_support;
544
545/// Private,
546///  crash-safe file primitives shared by every durable record.
547pub mod private_storage;
548
549/// Where short-lived private files live:
550///  the per-user scratch directory and the repository scratch directory,
551///  never the system temporary directory.
552pub mod scratch_location;
553
554/// Compact JSON records read and written with the incumbent's `JSON` semantics.
555pub mod json_record;
556
557/// Random identifiers in the layout of the incumbent's `randomUUID`.
558pub mod random_id;
559
560/// Text operations with the exact semantics of JavaScript's built-ins.
561pub mod js_text;
562
563/// The PID namespace an owner record names, and the rule for owners of another one.
564pub mod pid_namespace;
565
566/// Process-birth identities in the incumbent's exact spelling.
567pub mod process_identity;
568
569/// The owner record inside every owner-lock directory.
570pub mod owner_lock_record;
571
572/// Line-oriented debug and warning diagnostics on standard error.
573pub mod diagnostic_log;
574
575/// The fail-closed failure of reading or recovering durable transaction state.
576pub mod recovery_error;
577
578/// The owner record of one commit-transaction directory and its liveness rule.
579pub mod transaction_owner;
580
581/// The schema-version-2 journal records of one commit transaction and their filenames.
582pub mod transaction_journal;
583
584/// UTC timestamps in the exact form of JavaScript's `toISOString`.
585pub mod iso_time;
586
587/// Running real Git for transaction,
588///  recovery and landing work.
589pub mod transaction_git;
590
591/// Lexical path normalization.
592pub mod lexical_path;
593
594/// The ban on Git starting the wrapper for a hook: no entry writer, no start-name dispatch.
595#[cfg(test)]
596#[path = "hook_self_invocation_tests.rs"]
597mod hook_self_invocation_tests;
598
599/// What `git cli-git doctor` reports from the configuration: configured hooks and the retired `hooks` key.
600pub mod doctor_config;
601
602/// The configured external hooks, read from the snapshot, and the loud report that none runs.
603pub mod external_hooks;
604
605/// The non-blocking warning for a configured `core.hooksPath`, decided from the configuration snapshot alone.
606pub mod traditional_hook_warning;
607
608/// `git cli-git doctor`: the traditional hooks a repository holds, which are unsupported.
609pub mod doctor;
610
611/// When a push needs the Git LFS upload, and the texts the parent prints around it.
612pub mod lfs_pre_push;
613
614/// What the Git LFS upload sends: the remote and the refs, read from the push and the configuration Git would read.
615pub mod lfs_upload_plan;
616
617/// The configuration the Git LFS upload plan reads, and the default remote derived from it.
618pub mod lfs_upload_settings;
619
620/// Hides the credentials inside URLs in the text relayed from `git-lfs`.
621pub mod lfs_output_mask;
622
623/// Which failed `git-lfs push` runs are tried again (server errors only), after how long, and the notice.
624pub mod lfs_server_retry;
625
626/// Whether a blob is a Git LFS pointer, decided as `git-lfs` decides it.
627pub mod lfs_pointer;
628
629/// The LFS objects a push introduces, found in process from the commits to be pushed.
630#[cfg(unix)]
631pub mod lfs_pointer_scan;
632
633/// The upload plan narrowed to the objects the push introduces, or to nothing.
634pub mod lfs_object_plan;
635
636/// The parent's bounded or interactive run of the Git LFS upload.
637pub mod lfs_upload;
638
639/// The Git LFS step before a push the caller typed: pre-check, plan and upload with the caller's streams.
640pub mod lfs_interactive;
641
642/// The check that `git-lfs` can start, made before a push that is preceded by the upload.
643pub mod lfs_push_precheck;
644
645/// The auto-push's bounded `git push`, preceded by the upload, its pre-check and its explanation.
646pub mod lfs_bounded_push;
647
648/// The push of a merge that integrated a lost race, planned and run inside the running wrapper.
649pub mod stacked_merge_push;
650
651/// Every real-Git start of the wrapper carries `core.hooksPath` pointing at a directory that never exists.
652pub mod hooks_off;
653
654/// No-follow file operations recovery and landing share.
655pub mod recovery_files;
656
657/// Test-only transaction phase markers, compiled into the release executable and armed only by an environment variable.
658pub mod transaction_phase;
659
660/// Git commands run against a transaction's shadow repository.
661pub mod shadow_git;
662
663/// Native conclusion cleanup reproduced in the owning worktree.
664pub mod conclusion_cleanup;
665
666/// Replay: the unified-diff parser of subsumption (`replay_patch`).
667pub mod replay_patch;
668
669/// Replay: the exact strict reverse check of subsumption (`replay_reverse_apply`).
670pub mod replay_reverse_apply;
671
672/// Replay: the one-sided extension of subsumption over zero-context hunks (`replay_containment`).
673pub mod replay_containment;
674
675/// Replay: capture order over the landed first-parent history and the per-path decision (`replay_capture_order`).
676pub mod replay_capture_order;
677
678/// Replay: the shadow-repository Git runner that every replay step uses (`replay_shadow`).
679pub mod replay_shadow;
680
681/// Replay: shared paths of the landed history and the prepared commit, with their three entries (`replay_shared_paths`).
682pub mod replay_shared_paths;
683
684/// Replay: the text half of subsumption over index-named blobs and hunks (`replay_subsumption_text`).
685pub mod replay_subsumption_text;
686
687/// Replay: subsumption rules and the synthetic merge base (`replay_subsumption`).
688pub mod replay_subsumption;
689
690/// Replay: the merge tree, the first conflicting landed commit, and the replayed commit rebuild (`replay_merge`).
691pub mod replay_merge;
692
693/// The empty tree's object name under each known object format.
694pub mod empty_tree;
695
696/// Files-backend ref reads that answer without a Git process or decline.
697pub mod ref_files;
698
699/// Proof, without a Git process, that a sequencer marker names nothing on the files ref storage.
700pub mod sequencer_marker;
701
702/// The invocation capture:
703///  repository layout, symbolic `HEAD`, conclusion kind, ref backend and base.
704pub mod capture_invocation;
705
706/// The private index and object store a commit's preparation selects, and the Git request that carries them.
707pub mod private_index_request;
708
709/// The shadow repository `config` file and the copied repository format.
710pub mod shadow_config;
711
712/// The shadow repository links to the real shared entries.
713pub mod shadow_links;
714
715/// The shadow ref store: snapshot, private target, symbolic refs and `HEAD`.
716pub mod shadow_refs;
717
718/// The shadow conclusion copies at preparation.
719pub mod conclusion_copy;
720
721/// Argument transforms of native preparation: normalisation, global split, `-a` removal and private arguments.
722pub mod commit_args;
723
724/// The private commit index: copies, selection modes, pathspec files and listings.
725pub mod commit_index;
726
727/// Native `git commit` in the shadow, the prepared commit read back and `prepared.json`.
728pub mod commit_preparation;
729
730/// Creation of the shadow repository of one transaction.
731pub mod shadow_create;
732
733/// The entries of an empty bare repository, created in-process instead of by `git init`.
734pub mod shadow_skeleton;
735
736/// A read of the assume-unchanged and skip-worktree marks of an index file.
737pub mod index_flags;
738
739/// Loading many blobs through one `git cat-file --batch`.
740pub mod blob_batch;
741
742/// Bringing added paths' worktree copies to their landed bytes.
743pub mod worktree_completion;
744
745/// The startup step of a command: isolated merges whose process died, and what an earlier release left behind.
746pub mod startup_gate;
747
748/// Process start times for lock owners,
749///  read from `/proc`,
750///  `ps` or the Windows process table.
751pub mod process_start;
752
753/// The Git version check run once before work that depends on Git's behavior.
754pub mod git_version;
755
756/// The private per-user cache of the version text, keyed by the Git executable's identity.
757pub mod git_version_cache;
758
759/// Processes holding a lock file open,
760///  found by device and inode.
761pub mod index_lock_holders;
762
763/// Parsers of `lsof -F pcDi` records and Restart Manager lines,
764///  matched by device and inode.
765pub mod index_lock_holder_parsers;
766
767/// Evidence about a foreign `index.lock` and the verdict it supports.
768pub mod index_lock_evidence;
769
770/// The Git command a forwarded invocation runs,
771///  after ordinary alias expansion.
772pub mod forwarded_command;
773
774/// Index-writer classification and the commands that coordinate with a landing.
775pub mod index_writer_commands;
776
777/// Waiting for a foreign index.lock under the classification rules and Git's backoff schedule.
778pub mod index_lock_wait;
779
780/// The landing location a forwarded index writer coordinates with:
781///  the real index and the registry.
782pub mod landing_location;
783
784/// Running a coordinated forwarded index writer:
785///  the landing lock held while real Git runs as a child.
786pub mod index_writer_forward;
787
788/// The `git merge` command lines the wrapper completes in isolation, and those it leaves to native Git.
789pub mod merge_options;
790
791/// The durable intent record of an isolated merge.
792pub mod merge_isolation_journal;
793
794/// The raw differences of an isolated merge and the worktree state of each changed path.
795pub mod merge_isolation_changes;
796
797/// Recovery of an isolated merge whose process died.
798pub mod merge_isolation_recovery;
799
800/// The commit message of an isolated merge.
801pub mod merge_isolation_message;
802
803/// The refusal findings of an isolated merge.
804pub mod merge_isolation_report;
805
806/// A true merge completed in isolation while the index holds staged changes.
807pub mod merge_isolation;
808
809/// Automatic maintenance decision: config record parsing and the enable and detach rules.
810pub mod maintenance_decision;
811
812/// Running automatic maintenance after a landing: the config read, then `git maintenance run --auto`.
813pub mod maintenance_run;
814
815/// Catching SIGINT, SIGTERM, SIGHUP and SIGQUIT while a Git child runs, and relaying only process-sent signals.
816pub mod signal_relay;
817
818/// Exact removal of retired hk hook registrations from one explicit Git configuration scope.
819pub mod maintenance_hk_config;
820
821/// The per-branch file name of the push failure notice: a reversible, flat, case-safe key.
822pub mod auto_push_branch_key;
823
824/// How long a command waits for the commit service's hold on the index, and the variable that sets it.
825pub mod wait_limit;
826
827/// The shared clock of every wait notice: the grace, the repeat interval and a queued commit's place in line.
828pub mod wait_progress;
829
830/// A watcher for waits that block on a child process: notices at the cadence and the child stopped at the bound.
831pub mod child_watch;
832
833/// The classes of Git step a commit starts for itself, with the bound and the notice grace of each.
834pub mod child_class;
835
836/// Read-only Git queries of the auto-push, each with a deadline and separate output streams.
837pub mod bounded_query;
838
839/// The auto-push's real `git push` with a deadline and its low-speed abort.
840pub mod bounded_push;
841
842/// The processes of this host that use a directory or a file.
843pub mod process_use;
844
845/// The processes below one process, read before it is stopped and signalled only while they are still the ones found.
846pub mod process_tree;
847
848/// The real Git of a push, its query runner and the failure types of a push.
849pub mod auto_push_single_flight;
850
851/// Where a plain `git push` of one named branch goes, from the configuration and the local refs.
852pub mod auto_push_destination;
853
854/// Publishing a landed commit that a moved remote branch rejected: the merge is made from objects alone and pushed.
855pub mod auto_push_reconcile;
856
857/// The paths of a dirty worktree and of a fast-forward, and their overlap.
858pub mod auto_push_dirty_paths;
859
860/// Post-commit auto-push of a landed commit: the push argv, the surfaced output and the failure reporting.
861pub mod auto_push;
862
863/// The post-commit gate over a landed commit: its events, its blocking and the backup it allows.
864pub mod post_commit;
865
866/// Authoritative manual-push updates discovered by a private dry-run push and confirmed with ls-remote.
867pub mod manual_push_porcelain;
868
869/// The updates a manual `git push` would send, learned from Git's own dry-run report and confirmed against the remote.
870pub mod manual_push_probe;
871
872/// Published-set and range computation for manual-push scans: which pushed commits a remote does not have.
873pub mod manual_push_range;
874
875/// An explicit push that lost a race: run as a child, merge in what landed on the remote and publish the merge.
876pub mod push_stacking;
877
878/// Starting a child again when the operating system refuses it for lack of processes, within a bounded wait.
879pub mod start_retry;
880
881/// The manual-push candidate scope of one push: the commits and trees the destination lacks.
882pub mod manual_push_lifecycle;
883/// The one failure type of the linked-worktree ignored-state copy and its diagnostics.
884pub mod worktree_copy_error;
885
886/// Which linked worktrees a worktree-creating Git command registered, before and after it ran.
887pub mod worktree_copy_registry;
888
889/// The ignored source paths a linked-worktree copy selects, and the path validation every selection passes.
890pub mod worktree_copy_selection;
891
892/// The deterministic parent-first manifest of a copy, and the mode application to a staged copy.
893pub mod worktree_copy_manifest;
894
895/// Exact comparison of manifest entries against the filesystem, and the source stability check after staging.
896pub mod worktree_copy_compare;
897
898/// The private, validated stage of one source's ignored state beside a destination worktree.
899pub mod worktree_copy_stage;
900
901/// The exclusive creation of one destination entry from the stage, and the identity captured after it.
902#[cfg(unix)]
903pub mod worktree_copy_install_entry;
904
905/// Installation of a validated stage into a new worktree, with preflight, batches and rollback on failure.
906#[cfg(unix)]
907pub mod worktree_copy_install;
908
909/// Removal of the paths a failed installation created, only where their identity and content still prove them cli-git's own.
910#[cfg(unix)]
911pub mod worktree_copy_rollback;
912
913/// The durable journal of one copy: exact encoding, strict validation, private storage and removal.
914#[cfg(unix)]
915pub mod worktree_copy_journal;
916
917/// The durable claim on a stage container's name, and the removal of stages an interrupted copy left behind.
918#[cfg(unix)]
919pub mod worktree_copy_stage_claim;
920
921/// The append-only install log of one stage: per-batch intents and creations, with resumption.
922#[cfg(unix)]
923pub mod worktree_copy_install_log;
924
925/// One journaled installation to an end, resumption from the log, and synchronization of a created worktree.
926#[cfg(unix)]
927pub mod worktree_copy_transaction;
928
929/// The settlement lock that serializes copy installation and recovery, its owner record, and inherited leases.
930#[cfg(unix)]
931pub mod worktree_copy_lock;
932
933/// Recovery of interrupted copies: registration checks, discards with notices, resumption, and the pending check.
934#[cfg(unix)]
935pub mod worktree_copy_recovery;
936
937/// The linked-worktree ignored-state copy around one forwarded Git invocation: the integrator's entry point.
938#[cfg(unix)]
939pub mod worktree_copy;
940
941/// Which forwarded invocations the copy applies to, and the child run that carries its settlement lease.
942pub mod worktree_copy_forward;
943
944/// The system configuration file a real Git executable reads, learned once per executable identity.
945pub mod git_system_config;
946
947/// In-process repository reads: the plain-text configuration reader that gives up on any spelling it cannot prove.
948pub mod repo_read_config_text;
949
950/// In-process repository reads: proof that no configuration scope sets `core.bare` or `core.worktree`.
951pub mod repo_read_config_scan;
952
953/// In-process repository reads: proof that every configuration value Git types at startup is one Git accepts silently.
954pub mod repo_read_config_typed;
955
956/// In-process repository reads: the location, Git paths and object format found from the file system.
957pub mod repo_read_layout;
958
959/// In-process repository reads: the layout turned into the shapes the wrapper's existing queries answer with.
960pub mod repo_read_adapter;
961
962/// In-process repository reads: object kinds, names and the zlib step shared by loose objects and packs.
963pub mod repo_read_object;
964
965/// In-process repository reads: one pack, its index lookup and delta resolution.
966#[cfg(unix)]
967pub mod repo_read_pack;
968
969/// In-process repository reads: the object database of a repository, its packs and alternates.
970#[cfg(unix)]
971pub mod repo_read_odb;
972
973/// The abbreviated object name Git prints (`core.abbrev`, the automatic length, uniqueness), computed without starting Git.
974#[cfg(unix)]
975pub mod object_abbreviation;
976
977/// In-process repository reads: trees, flattened trees and commit fields.
978#[cfg(unix)]
979pub mod repo_read_tree;
980
981/// In-process repository reads: the entries of an index file, versions 2 to 4.
982pub mod repo_read_index;
983
984/// In-process repository reads: the difference between two sorted entry lists and the output spellings.
985#[cfg(unix)]
986pub mod repo_read_diff;
987
988/// In-process repository reads: the files ref storage, one ref by name, a symbolic chain and the list of all refs.
989#[cfg(unix)]
990pub mod repo_read_refs;
991
992/// In-process repository reads: the merged configuration listing with includes and environment entries.
993pub mod repo_read_config_list;
994
995/// In-process repository reads: answers to the exact read-only command lines the wrapper issues.
996#[cfg(unix)]
997pub mod repo_read_query;
998
999/// In-process repository reads: answers for the reference and configuration command lines.
1000#[cfg(unix)]
1001pub mod repo_read_query_refs;
1002
1003/// In-process repository reads: the two runner entry points that try the answers before starting Git.
1004pub mod repo_read_hook;
1005
1006/// The standards-review shadow run: JavaScript text behaviors the log depends on (UTF-16 lengths, number text).
1007pub mod standards_review_text;
1008
1009/// The standards-review shadow run: a file's changed old-side ranges read from the patch.
1010pub mod standards_review_patch;
1011
1012/// The standards-review shadow run: which commits get an entry, and the capped model input.
1013pub mod standards_review_input;
1014
1015/// The standards-review shadow run: the Decisions API request body and the answer reading.
1016pub mod standards_review_request;
1017
1018/// The standards-review shadow run: log entry rendering and appending.
1019pub mod standards_review_entry;
1020
1021/// The standards-review shadow run: the in-process HTTPS call to the decisions gateway, with a total deadline.
1022pub mod standards_review_client;
1023
1024/// The standards-review shadow run: the two real-Git reads (patch and file texts) of a landed commit.
1025pub mod standards_review_source;
1026
1027/// The standards-review shadow run, end to end, and its bounded runner. Nothing calls it yet.
1028pub mod standards_review_run;
1029
1030/// A loopback HTTP server for the standards-review tests; never in the release build.
1031#[cfg(test)]
1032mod standards_review_mock;
1033
1034/// The durable work-item record for asynchronous work (review, push, maintenance) left for a resident consumer.
1035pub mod work_item;
1036
1037/// The clocks a claim's lease is judged by.
1038pub mod claim_time;
1039
1040/// The repositories the service looks at again when a claim another instance holds may have run out.
1041pub mod service_retry;
1042
1043/// Messages between the wrapper and the resident commit service.
1044pub mod service_protocol;
1045
1046/// What the user is told when the commit service cannot land a commit.
1047pub mod service_messages;
1048
1049/// The commit service's journal and its restart decisions.
1050pub mod service_journal;
1051
1052/// Test-only fault points of the commit service.
1053pub mod service_fault;
1054
1055/// The commit service's serialized step.
1056pub mod service_land;
1057
1058/// What the commit service's landing does once the branch has moved: index entries and conclusion state.
1059pub mod service_land_follow;
1060
1061/// The commit service's hold on Git's index lock across a landing.
1062pub mod service_index_lock;
1063
1064/// The preparation of a commit that the service lands, for every command line.
1065pub mod service_prepare;
1066
1067/// The commit service's loop.
1068pub mod service_server;
1069
1070/// The wrapper's side of a commit through the commit service.
1071pub mod service_client;
1072
1073/// Which commit command lines the commit service covers, and the message they stand for.
1074pub mod service_commit_args;
1075
1076/// The one summary line a landed commit prints, with the abbreviated name Git would print.
1077pub mod landed_summary;
1078
1079/// The wait of a wrapped index writer for the commit service's own hold on the index.
1080pub mod service_index_wait;
1081
1082/// A forwarded index writer started again when the commit service took the index before its Git did.
1083pub mod service_hold_retry;
1084
1085/// The commit command's path through the commit service.
1086pub mod service_commit;
1087
1088/// The service's memory of when the bytes of the commits it landed were captured, per worktree.
1089pub mod service_captures;
1090
1091/// The retry of a commit the service sent back: the captured change merged onto the branch, never prepared again from the worktree.
1092pub mod service_replay;
1093
1094/// Which way a commit goes: through the service, set up first, or the earlier path.
1095pub mod service_route;
1096
1097/// The wrapper's own provisioning of the commit service's socket activation.
1098pub mod service_provision;
1099
1100/// A minimal D-Bus client for the user session bus, for the provisioning's two calls.
1101pub mod systemd_dbus;
1102
1103/// The message and identities of a service commit, made as native `git commit` makes them.
1104pub mod service_message;
1105
1106/// What an amend takes from the commit it replaces: parents, message and author.
1107pub mod service_amend;
1108
1109/// The commits real Git builds for the service: an editor, a signature, and what the service does not embed.
1110pub mod service_native;
1111
1112/// The renewal that keeps the claims of a shared work directory from looking abandoned while their holder works.
1113pub mod service_claim_renewal;
1114
1115/// The service's consumer of after-commit push and upkeep work.
1116pub mod service_work;
1117
1118/// The wrapper's side of after-commit work: records and the wake.
1119pub mod service_handoff;
1120
1121/// Which commit service instance belongs to a worktree: its name, socket and unit instances.
1122pub mod service_instance;
1123
1124/// Whether a worktree's head still names the branch a commit was prepared on.
1125pub mod service_head;
1126
1127/// How a commit headed for the service notices that its prepared content was removed before it landed.
1128pub mod service_pruned;
1129
1130/// The record of a failed backup push and the rule for when a wrapper command shows it.
1131pub mod push_failure_notice;
1132
1133/// What becomes of the unshown push notices and unfinished pushes of a linked worktree that Git removes.
1134pub mod worktree_removal_rescue;
1135
1136/// The words that say how to change the push deadline, for the terminal and for the resident commit service.
1137pub mod push_deadline_advice;
1138
1139/// The mechanical ban: no release code starts the wrapper, passes it management words or writes shell text.
1140#[cfg(test)]
1141#[path = "no_self_invocation_tests.rs"]
1142mod no_self_invocation_tests;
1143
1144/// The structural check that the review's network client is reachable only from the service run; never in the release build.
1145#[cfg(test)]
1146mod standards_review_boundary_tests;
1147
1148/// The standards-review shadow run: appending an entry to the shared log without a lock, once per commit, with repair.
1149pub mod standards_review_append;
1150
1151/// The service's handler for a review work item, bounded by a call deadline and a total budget.
1152pub mod service_review;
1153
1154/// The standards-review credential: redacted when printed, read from the wrapper's environment, sent in the work message.
1155pub mod service_review_key;
1156
1157/// The typed failure of one Linux filesystem primitive:
1158///  the call, the path and the error number.
1159#[cfg(target_os = "linux")]
1160pub mod fs_primitive_error;
1161
1162/// Which filesystem holds a path (btrfs, overlayfs, other) and whether a directory is a btrfs subvolume root.
1163#[cfg(target_os = "linux")]
1164pub mod fs_kind;
1165
1166/// The mount of a path read from `/proc/self/mountinfo`, with its options (`user_subvol_rm_allowed`).
1167#[cfg(target_os = "linux")]
1168pub mod fs_mount_options;
1169
1170/// The btrfs ioctls that create, snapshot and destroy a subvolume, called in process.
1171#[cfg(target_os = "linux")]
1172pub mod fs_btrfs_ioctl;
1173
1174/// `FICLONE` of one file into another and the atomic `RENAME_EXCHANGE` of two paths.
1175#[cfg(target_os = "linux")]
1176pub mod fs_clone_exchange;
1177
1178/// The btrfs fixture root of the primitive and migration controls, and the loud report where there is none.
1179#[cfg(all(test, target_os = "linux"))]
1180mod fs_btrfs_test_support;
1181
1182/// SHA-1 and SHA-256, for the checksum of a rewritten Git index.
1183#[cfg(target_os = "linux")]
1184pub mod subvolume_sha;
1185
1186/// The stat rewrite of a Git index file's bytes.
1187#[cfg(target_os = "linux")]
1188pub mod subvolume_index;
1189
1190/// The linked worktrees of a main checkout and the index stat rewrite applied to files.
1191#[cfg(target_os = "linux")]
1192pub mod subvolume_index_files;
1193
1194/// The failure type of the subvolume migration and its simulated-kill hook.
1195#[cfg(target_os = "linux")]
1196pub mod subvolume_error;
1197
1198/// The operating-system operations of the migration behind one trait, and the Linux implementation.
1199#[cfg(target_os = "linux")]
1200pub mod subvolume_platform;
1201
1202/// Copying owner, permissions, times and extended attributes onto a copy.
1203#[cfg(target_os = "linux")]
1204pub mod subvolume_sync_attrs;
1205
1206/// One idempotent pass that makes a directory tree match another, in process.
1207#[cfg(target_os = "linux")]
1208pub mod subvolume_sync;
1209
1210/// The index locks the migration holds, marked with a token that names the migration.
1211#[cfg(target_os = "linux")]
1212pub mod subvolume_lock;
1213
1214/// An open directory that every operation inside it is addressed through, so a replaced path cannot redirect them.
1215#[cfg(target_os = "linux")]
1216pub mod subvolume_anchor;
1217
1218/// Removal of a directory tree whose directories may lack owner write permission.
1219#[cfg(target_os = "linux")]
1220pub mod subvolume_remove;
1221
1222/// The migration journal beside the checkout.
1223#[cfg(target_os = "linux")]
1224pub mod subvolume_journal;
1225
1226/// The paths of a migration and the refusals that stop it before anything is created.
1227#[cfg(target_os = "linux")]
1228pub mod subvolume_preflight;
1229
1230/// The state a migration command carries between its steps.
1231#[cfg(target_os = "linux")]
1232pub mod subvolume_run;
1233
1234/// Converting a main checkout into a btrfs subvolume, resumably.
1235#[cfg(target_os = "linux")]
1236pub mod subvolume_migrate;
1237
1238/// Undoing a migration and deleting the old tree.
1239#[cfg(target_os = "linux")]
1240pub mod subvolume_rollback;
1241
1242/// The grammar of `git cli-git migrate-to-subvolume`.
1243pub mod subvolume_arguments;
1244
1245/// `git cli-git migrate-to-subvolume`: root discovery, modes and exit statuses.
1246#[cfg(target_os = "linux")]
1247pub mod subvolume_command;
1248
1249/// The stand-in platform and fixture checkouts of the subvolume migration controls.
1250#[cfg(all(test, target_os = "linux"))]
1251mod subvolume_test_support;
1252
1253/// The migration controls that need the real btrfs ioctls, `FICLONE` and exchange.
1254#[cfg(all(test, target_os = "linux"))]
1255mod subvolume_btrfs_tests;
1256
1257/// Quoting of bytes printed inside a shell command for a person to run.
1258#[cfg(target_os = "linux")]
1259pub mod shell_quote;
1260
1261/// The filesystem section of `git cli-git doctor`: btrfs subvolume, overlayfs, the removal mount option and its commands.
1262#[cfg(target_os = "linux")]
1263pub mod doctor_filesystem;