Expand description
The system configuration file a real Git executable reads, learned once per executable identity.
What:
The system configuration file that one real Git executable reads when GIT_CONFIG_SYSTEM is not set,
learned once per executable identity and cached beside the git version cache.
Why:
Git compiles the path in (ETC_GITCONFIG, /etc/gitconfig for a build with prefix /usr, and under the prefix
for any other build, resolved against the executable’s own location in a runtime-prefix build), so no reader may
assume /etc/gitconfig.
git var GIT_CONFIG_SYSTEM prints the path the executable would read, with the environment’s own overrides
removed from its start, so the path is a property of the executable’s bytes and location, which the identity of
git_version_cache captures.
An executable without an identity (a script, a shim) or an answer that is not an absolute path is unknown, and
the readers then leave the question to Git.
In TS you’d write (pseudocode):
const path = cached(identity, 'git-system-config') ?? (await run(realGit, ['var', 'GIT_CONFIG_SYSTEM'])); // undefined: unknownConstants§
- SYSTEM_
CONFIG_ KIND - The kind of the cache file that holds the compiled-in system configuration path.
Functions§
- parse_
path_ line - What:
The path text
git var GIT_CONFIG_SYSTEMprinted, when it is one absolute path on one line. Why: Any other output (nothing, a relative path, several lines) is not a fact the readers can use. - system_
config_ for - What:
The system configuration path the Git a child would run reads, learned from the forward-target variable the wrapper
puts in every child’s environment.
Why:
None(no variable, no identity, no answer) makes the readers decline whenever the system file would be read. - system_
config_ of - What:
The system configuration path of the executable at
real_git: from the cache when the identity matches, otherwise fromask, recorded for the next start. Why: The question runs once per executable;askis a parameter so a control can count the starts and give a Git whose prefix is not/usr. - with_
real_ git - What:
variableswith the forward-target variable added forreal_gitwhen the variables do not name one. Why: The wrapper process learns the system configuration path from the real Git named by that variable. The environmententry.rsbuilds always carries it, but a resident process (the service) and callers that hold only a Git path and a bare overlay do not, and without it every read there would decline; the caller knows the Git it runs.