Skip to main content

Module command_add

Module command_add 

Source
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 add region. 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.
BulkMatch
What: One bulk-staging match. usize is the list index type. Why: The token index lets the diagnostic quote the caller’s exact spelling.

Enums§

BulkKind
What: Why a token stages in bulk. An enum is 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, -U and --inter-hunk-context take 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 success A or failure B”. Why: A region Git itself would refuse yields the refusal, never a guessed fact set.