Expand description
The form and file scope of a git config region.
What:
The form and file scope of a git config region,
read as Git 2.56.0 reads it.
Why:
The require-root policy exempts git config when it works on the per-user or
system file,
or lists.
Whether --global is that option or a value being stored
depends on the form:
git config user.name --global writes the text --global
into the repository’s own configuration.
Gotcha:
Git also refuses two different actions of the form without a subcommand word
(--list --get);
that conflict is not modeled,
so such a region still reports
its listing.
Git then runs nothing.
In TS you’d write (pseudocode):
// parseConfigRegion(['--global', 'user.name']).global === true
// parseConfigRegion(['user.name', '--global']).global === falseStructs§
- Config
Region - What:
Facts of one
git configregion.Vec<WrapperOccurrence>is an owned growable list of wrapper-only flags. Why: The require-root decision reads the scope and the listing action; the caller removes its wrapper-only flags by the positions reported here.
Enums§
- Config
Form - What:
The form
cmd_configdispatches to (builtin/config.c:1633-1660). Anenumis a closed set of named alternatives. Why:Legacyis the form without a subcommand word, where actions are options such as--listand--get.
Functions§
- config_
table - What:
The complete option table of one form,
assembled from Git’s groups in Git’s
order.
Vec<OptionSpec>is an owned list, built once per parse. Why: The completion control compares each assembled table with the binary’s. - parse_
config_ region - What:
Parse the region after
git config.Result<A, B>is “either successAor failureB”;wrapper_flagsare the caller’s wrapper-only spellings. Why: Git looks at the first token only to pick the form. A subcommand word selects its table; a leading--is dropped by that first look, so the form without a subcommand then reads the rest as options again (config.c:1643-1660). Leading wrapper flags are skipped first, because the wrapper removes them before Git runs:git config --cli-git-keep-going listreaches Git asgit config list.