Reading and writing Git configuration files.
Todo
- preserve formatting when updating configuration files
| Class | |
A case-insensitive ordered dictionary that can store multiple values per key. |
| Class | |
A Git configuration. |
| Class | |
Git configuration stored in a dictionary. |
| Class | |
A Git configuration file, like .git/config or ~/.gitconfig. |
| Class | |
Configuration which reads from multiple config files.. |
| Function | apply |
Apply insteadOf / pushInsteadOf to a URL. |
| Function | get |
Look up the core.gitProxy command for the given host. |
| Function | get |
Get legacy Windows system Git config paths. |
| Function | get |
Get current Windows system Git config paths. |
| Function | get |
Get a path in the XDG config home directory. |
| Function | iter |
Iterate over insteadOf / pushInsteadOf values. |
| Function | lower |
Convert a config key to lowercase, preserving subsection case. |
| Function | match |
Match a value against a glob pattern. |
| Function | parse |
Parse a gitmodules GitConfig file, returning submodules. |
| Function | read |
Read a .gitmodules file. |
| Constant | DEFAULT |
Undocumented |
| Constant | MAX |
Undocumented |
| Type Variable | K |
Undocumented |
| Type Variable | V |
Undocumented |
| Type Alias | |
Undocumented |
| Type Alias | |
Undocumented |
| Type Alias | |
Undocumented |
| Variable | |
Undocumented |
| Variable | |
Undocumented |
| Variable | logger |
Undocumented |
| Variable | |
Undocumented |
| Variable | |
Undocumented |
| Variable | |
Undocumented |
| Function | _check |
Undocumented |
| Function | _check |
Undocumented |
| Function | _escape |
Escape a value. |
| Function | _find |
Undocumented |
| Function | _find |
Undocumented |
| Function | _format |
Undocumented |
| Function | _is |
Check if a value ends with a line continuation backslash. |
| Function | _match |
Simple gitdir pattern matching for includeIf conditions. |
| Function | _parse |
Undocumented |
| Function | _parse |
Undocumented |
| Function | _strip |
Undocumented |
| Constant | _COMMENT |
Undocumented |
| Constant | _ESCAPE |
Undocumented |
| Constant | _WHITESPACE |
Undocumented |
| Type Variable | _T |
Undocumented |
Look up the core.gitProxy command for the given host.
The core.gitProxy variable can appear multiple times, each with an optional for <domain> suffix. The first entry whose domain suffix matches the end of host wins; an entry without a for clause is a catch-all default.
| Parameters | |
config:Config | A Config instance. |
host:str | The hostname being connected to. |
| Returns | |
str | None | The proxy command string, or None if no proxy is configured. |
Get legacy Windows system Git config paths.
Returns all possible config paths including deprecated locations. This function can be used for diagnostics or migration purposes.
Get current Windows system Git config paths.
Only returns the current Git for Windows config location, not legacy paths.
Match a value against a glob pattern.
Supports simple glob patterns like * and **.
| Raises | |
ValueError | If the pattern is invalid |
Parse a gitmodules GitConfig file, returning submodules.
| Parameters | |
config:ConfigFile | A ConfigFile |
| Returns | |
Iterator[ |
|
Check if a value ends with a line continuation backslash.
A line continuation occurs when a line ends with a backslash that is: 1. Not escaped (not preceded by another backslash) 2. Not within quotes
| Parameters | |
value:bytes | The value to check |
| Returns | |
bool | True if the value ends with a line continuation backslash |
Simple gitdir pattern matching for includeIf conditions.
This handles the basic gitdir patterns used in includeIf directives.