module documentation

Reading and writing Git configuration files.

TODO

  • preserve formatting when updating configuration files
  • treat subsection names as case-insensitive for [branch.foo] style subsections
Class CaseInsensitiveOrderedMultiDict Undocumented
Class Config A Git configuration.
Class ConfigDict Git configuration stored in a dictionary.
Class ConfigFile A Git configuration file, like .git/config or ~/.gitconfig.
Class StackedConfig Configuration which reads from multiple config files..
Function apply_instead_of Apply insteadOf / pushInsteadOf to a URL.
Function get_win_system_paths Undocumented
Function get_xdg_config_home_path Undocumented
Function iter_instead_of Iterate over insteadOf / pushInsteadOf values.
Function lower_key Undocumented
Function parse_submodules Parse a gitmodules GitConfig file, returning submodules.
Function read_submodules read a .gitmodules file.
Constant SENTINEL Undocumented
Type Alias NameLike Undocumented
Type Alias Section Undocumented
Type Alias SectionLike Undocumented
Type Alias ValueLike Undocumented
Function _check_section_name Undocumented
Function _check_variable_name Undocumented
Function _escape_value Escape a value.
Function _find_git_in_win_path Undocumented
Function _find_git_in_win_reg Undocumented
Function _format_string Undocumented
Function _parse_section_header_line Undocumented
Function _parse_string Undocumented
Function _strip_comments Undocumented
Constant _COMMENT_CHARS Undocumented
Constant _ESCAPE_TABLE Undocumented
Constant _WHITESPACE_CHARS Undocumented
def apply_instead_of(config, orig_url, push=False):

Apply insteadOf / pushInsteadOf to a URL.

Parameters
config:ConfigUndocumented
orig_url:strUndocumented
push:boolUndocumented
Returns
strUndocumented
def get_win_system_paths():

Undocumented

def get_xdg_config_home_path(*path_segments):

Undocumented

def iter_instead_of(config, push=False):

Iterate over insteadOf / pushInsteadOf values.

Parameters
config:ConfigUndocumented
push:boolUndocumented
Returns
Iterable[Tuple[str, str]]Undocumented
def lower_key(key):

Undocumented

def parse_submodules(config):

Parse a gitmodules GitConfig file, returning submodules.

Parameters
config:ConfigFileA ConfigFile
Returns
Iterator[Tuple[bytes, bytes, bytes]]
list of tuples (submodule path, url, name),
where name is quoted part of the section's name.
def read_submodules(path):

read a .gitmodules file.

Parameters
path:strUndocumented
Returns
Iterator[Tuple[bytes, bytes, bytes]]Undocumented
SENTINEL =

Undocumented

Value
object()
NameLike =

Undocumented

Value
Union[bytes, str]
Section =

Undocumented

Value
Tuple[bytes, ...]
SectionLike =

Undocumented

Value
Union[bytes, str, Tuple[Union[bytes, str], ...]]
ValueLike =

Undocumented

Value
Union[bytes, str]
def _check_section_name(name):

Undocumented

Parameters
name:bytesUndocumented
Returns
boolUndocumented
def _check_variable_name(name):

Undocumented

Parameters
name:bytesUndocumented
Returns
boolUndocumented
def _escape_value(value):

Escape a value.

Parameters
value:bytesUndocumented
Returns
bytesUndocumented
def _find_git_in_win_path():

Undocumented

def _find_git_in_win_reg():

Undocumented

def _format_string(value):

Undocumented

Parameters
value:bytesUndocumented
Returns
bytesUndocumented
def _parse_section_header_line(line):

Undocumented

Parameters
line:bytesUndocumented
Returns
Tuple[Section, bytes]Undocumented
def _parse_string(value):

Undocumented

Parameters
value:bytesUndocumented
Returns
bytesUndocumented
def _strip_comments(line):

Undocumented

Parameters
line:bytesUndocumented
Returns
bytesUndocumented
_COMMENT_CHARS =

Undocumented

Value
[ord(b'#'), ord(b';')]
_ESCAPE_TABLE =

Undocumented

Value
{ord(b'\\'): ord(b'\\'),
 ord(b'"'): ord(b'"'),
 ord(b'n'): ord(b'\n'),
 ord(b't'): ord(b'\t'),
 ord(b'b'): ord(b'\x08')}
_WHITESPACE_CHARS =

Undocumented

Value
[ord(b'\t'), ord(b' ')]