Expand description
The Git 2.56.0 option table of git add and its bulk-staging facts.
What:
The complete git add option table of Git 2.56.0 and the bulk-staging facts read
from it.
Why:
The add-explicit policy rejects staging that names no explicit path.
Git accepts
-A inside any cluster (-vA),
by abbreviation (--al) and through
--no-ignore-removal;
a list of exact tokens misses those.
In TS you’d write (pseudocode):
// parseAddRegion(postSubcommandArgs): AddRegion (throws OptionError)Structs§
- AddRegion
- What:
Facts of one
git addregion.Vec<BulkMatch>is an owned list in argument order. Why: The add-explicit policy rejects when the list is non-empty and no hatch is given. - Bulk
Match - What:
One bulk-staging match.
usizeis the list index type. Why: The token index lets the diagnostic quote the caller’s exact spelling.
Enums§
- Bulk
Kind - What:
Why a token stages in bulk.
An
enumis a closed set of named alternatives. Why: The policy names the matched tokens; the kind says which Git meaning matched.
Constants§
- ADD_
ESCAPE_ HATCH - Wrapper-only flag that suppresses bulk-add enforcement for one invocation.
- ADD_
TABLE - What:
Rows of
builtin_add_options(builtin/add.c:261-292), in source order.&[OptionSpec]is a borrowed table baked into the program. Why: Only--chmod,--pathspec-from-file,-Uand--inter-hunk-contexttake a value; every other token after an option is a pathspec. - ALL
-A,--all.- IGNORE_
REMOVAL --ignore-removal, the same variable as--no-all(builtin/add.c:252-259).- RESOLVED
--resolved: add every conflict-resolved tracked file.- UPDATE
-u,--update.
Functions§
- parse_
add_ region - What:
Parse the region after
add.Result<A, B>is “either successAor failureB”. Why: A region Git itself would refuse yields the refusal, never a guessed fact set.