Git provides for reading default rules from the user's home directory (e.g. ~/.gitignore). This requires special treatment since ignore rules are interpreted relative to the directory in which the ignore file is located and not just the user's home directory.
Emulating this functionality is already present with the optional base_dir argument to _parse_rule_file (except it is currently broken). I would like to recommend that the base_dir parameter be returned to working order, and that _parse_rule_file be promoted to a public method (i.e. just remove the leading underline '_').
Fixing base_dir can be accomplised with a single line of code:
path_base_dir = base_dir if base_dir is not None else path_rule_file.parent
User's can then effectively append multiple default ignore files as if they were all part of a single ignore file in the target directory.
Git provides for reading default rules from the user's home directory (e.g. ~/.gitignore). This requires special treatment since ignore rules are interpreted relative to the directory in which the ignore file is located and not just the user's home directory.
Emulating this functionality is already present with the optional
base_dir
argument to_parse_rule_file
(except it is currently broken). I would like to recommend that thebase_dir
parameter be returned to working order, and that_parse_rule_file
be promoted to a public method (i.e. just remove the leading underline '_').Fixing base_dir can be accomplised with a single line of code:
User's can then effectively append multiple default ignore files as if they were all part of a single ignore file in the target directory.