Expand description
Repository-root discovery and bounded reading of cli-git.config.jsonc.
What:
Find and read cli-git.config.jsonc at a repository root.
Why:
Configuration is one data file at one fixed place;
legacy executable
configuration is reported for migration and never read,
run or silently ignored.
In TS you’d write (pseudocode):
// loadRepositoryConfig(root) returns { config, source, ignoredLegacy } or throws ConfigError.Structs§
- Loaded
Config - What:
The outcome of loading one repository’s configuration.
Option<PathBuf>is “an owned path or nothing”;Vec<PathBuf>is an owned list. Why: Callers need the settings, the file they came from for diagnostics, and any legacy file that was left beside an authoritative JSONC file so they can report it instead of ignoring it silently.
Constants§
- CONFIG_
FILE_ NAME - The only configuration file the native wrapper reads.
- LEGACY_
CONFIG_ FILE_ NAMES - What:
Executable configuration names of the TypeScript wrapper,
in its lookup order.
&[&str]is a borrowed list of borrowed strings compiled into the executable. Why: Their presence must produce a migration diagnostic. - MAX_
CONFIG_ BYTES - What:
Largest accepted configuration file,
one mebibyte.
u64is an unsigned 64-bit integer, the type of file sizes (siblingusize). Why: A repository file must not control how much memory every Git command reads.
Functions§
- ignored_
legacy_ notice - What:
Describe a legacy file that sits beside an authoritative JSONC file.
Stringis owned text returned to the caller. Why: The executable prints this so the stale file is never ignored silently. - load_
repository_ config - What:
Load the configuration of the repository whose top level is
repository_root. Why: This is the single entry point for policy settings. Nothing in a repository is executed: the JSONC file is parsed as data, and legacy.mjs/.tsconfiguration is only detected by name.