module documentation

Parsing of gitignore files.

For details for the matching rules, see https://git-scm.com/docs/gitignore

Class IgnoreFilter No class docstring; 0/3 instance variable, 3/5 methods, 0/1 class method documented
Class IgnoreFilterManager Ignore file manager.
Class IgnoreFilterStack Check for ignore status in multiple filters.
Class Pattern A single ignore pattern.
Function default_user_ignore_filter_path Return default user ignore filter path.
Function match_pattern Match a gitignore-style pattern against a path.
Function read_ignore_patterns Read a git ignore file.
Function translate Translate a shell PATTERN to a regular expression.
Function _translate_segment Undocumented
def default_user_ignore_filter_path(config):

Return default user ignore filter path.

Parameters
config:ConfigA Config object
Returns
strPath to a global ignore file
def match_pattern(path, pattern, ignorecase=False):

Match a gitignore-style pattern against a path.

Parameters
path:bytesPath to match
pattern:bytesPattern to match
ignorecase:boolWhether to do case-sensitive matching
Returns
boolbool indicating whether the pattern matched
def read_ignore_patterns(f):

Read a git ignore file.

Returns: List of patterns

Parameters
f:BinaryIOFile-like object to read from
Returns
Iterable[bytes]Undocumented
def translate(pat):

Translate a shell PATTERN to a regular expression.

There is no way to quote meta-characters.

Originally copied from fnmatch in Python 2.7, but modified for Dulwich to cope with features in Git ignore patterns.

Parameters
pat:bytesUndocumented
Returns
bytesUndocumented
def _translate_segment(segment):

Undocumented

Parameters
segment:bytesUndocumented
Returns
bytesUndocumented