Skip to main content

Module config

Module config 

Source
Expand description

Reading and writing git configuration through a library.

Spawning git config is not an option: git starts a filter process per operation, so it would be N process spawns on the hot path — most expensive on exactly the platform where it hurts most. Writing only ever touches the repository-local file, which is the only one this tool has business changing.

Functions§

get
Reads a dotted key, if present.
global_attributes_file
The global attributes file, resolved the way git resolves it.
is_true
Whether a value is one of git’s spellings of true.
open_full
The configuration git itself would see, for reading only.
open_local
The repository-local configuration, loaded for editing.
save_local
Writes a configuration file back to disk, replacing it in one step.
set
Sets a dotted key such as filter.git-xcrypt.required, creating what is missing.
unset
Removes a dotted key, if it is there at all.