git_policy_cli/command/mod.rs
1//! What:
2//! Per-command handling:
3//! the option grammar of each Git command the wrapper understands,
4//! and the rules that rewrite,
5//! refuse or hint at a command.
6//! Why:
7//! The wrapper judges commands one by one,
8//! so everything that is about a single Git command lives together.
9//!
10//! In TS you'd write (pseudocode):
11//! ```ts
12//! // command/index.ts: one `export * from './file'` per module below.
13//! ```
14
15/// Git 2.56.0 `parse-options` tokenization of one command's argument region.
16pub mod command_options;
17
18/// Long-option matching:
19/// exact names,
20/// unique abbreviations and `no-` negation.
21pub(crate) mod command_options_long;
22
23/// Final-state and position questions over a tokenized region.
24pub mod command_options_query;
25
26/// Short-option clusters and their attached or following values.
27pub(crate) mod command_options_short;
28
29/// The shared decision of which bytes are an option's value.
30pub(crate) mod command_options_value;
31
32/// Real-Git fixtures and table oracles for command tests;
33/// never in the release build.
34#[cfg(test)]
35pub(crate) mod command_test_support;
36
37/// Per-case copies of a pristine fixture and worker threads for independent test cases;
38/// never in the release build.
39#[cfg(test)]
40pub(crate) mod command_test_cases;
41
42/// Differential harness over `git rev-parse --parseopt`;
43/// never in the release build.
44#[cfg(test)]
45pub(crate) mod command_test_parseopt;
46
47/// Table oracle over `--git-completion-helper-all`;
48/// never in the release build.
49#[cfg(test)]
50pub(crate) mod command_test_completion;
51
52/// Facts about the arguments after `git commit`.
53pub mod command_commit;
54
55/// The complete Git 2.56.0 option table of `git commit`.
56pub mod command_commit_table;
57
58/// The shared result and builder of transforms that add tokens to a command line.
59pub mod rule_argument_rewrite;
60
61/// The query and reading of "does this worktree hold uncommitted state?".
62pub mod rule_worktree_dirty;
63
64/// The Git 2.56.0 option table of `git push` and its facts.
65pub mod command_push;
66
67/// The Git 2.56.0 option table of `git status`,
68/// its facts and the advice-key reading.
69pub mod command_status;
70
71/// Pure decision of the atomic-push transform.
72pub mod rule_atomic_push;
73
74/// Pure decision of the status-hints transform.
75pub mod rule_status_hints;
76
77/// The Git 2.56.0 option table of `git add` and its bulk-staging facts.
78pub mod command_add;
79
80/// The Git 2.56.0 option table of `git clean` and its deletion facts.
81pub mod command_clean;
82
83/// The Git 2.56.0 option table of `git reset` and its mode.
84pub mod command_reset;
85
86/// `git stash` subcommand dispatch and wrapper-flag positions.
87pub mod command_stash;
88
89/// The commands that can overwrite or delete uncommitted state, read as Git reads them.
90pub mod command_discard;
91
92/// The Git 2.56.0 option tables of every `git stash` subcommand.
93pub mod command_stash_table;
94
95/// Branch-creation facts of `git branch`,
96/// `git checkout` and `git switch`.
97pub mod command_branch_create;
98
99/// Which action a tokenized `git branch` region selects.
100pub(crate) mod command_branch_mode;
101
102/// The complete Git 2.56.0 option table of `git branch`.
103pub mod command_branch_table;
104
105/// Explicit creation and the remote-guess candidate of `git checkout` and `git switch`.
106pub(crate) mod command_branch_target;
107
108/// The complete Git 2.56.0 option tables of `git checkout` and `git switch`.
109pub mod command_checkout_table;
110
111/// The Git 2.56.0 option groups of `git config`.
112pub mod command_config_table;
113
114/// The form and file scope of a `git config` region.
115pub mod command_config;
116
117/// Pure decision of the require-root policy.
118pub mod rule_require_root;
119
120/// Whether a `git worktree` invocation changes worktree registrations (an add or a move).
121pub mod command_worktree;
122
123/// Pure decision of the linked-worktree-only policy.
124pub mod rule_linked_worktree;
125
126/// The rejection texts of the linked-worktree-only policy.
127pub mod rule_linked_worktree_messages;
128
129/// Pure decision of the branch-worktree-only policy and its one-query remote guess.
130pub mod rule_branch_worktree;
131
132/// Pure decision of the add-explicit policy.
133pub mod rule_add_explicit;