Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default ignore file in home directory #21

Closed
1 of 3 tasks
hellcats opened this issue Apr 7, 2021 · 2 comments
Closed
1 of 3 tasks

Default ignore file in home directory #21

hellcats opened this issue Apr 7, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@hellcats
Copy link

hellcats commented Apr 7, 2021

  • **I'm submitting a ... **
    • bug report
    • feature request
    • support request

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.

 igittigitt.parse_rule_file("~/.myignore', base_dir=target_dir)
 igittigitt.parse_rule_files(target_dir, '.myignore')
@bitranox bitranox self-assigned this Apr 7, 2021
@bitranox bitranox added the enhancement New feature or request label Apr 7, 2021
@bitranox
Copy link
Owner

bitranox commented Apr 7, 2021

ok, not sure what You are talking about ATM - I will look into it later and come back probably with questions

@bitranox
Copy link
Owner

good news - default ignore files are implemented in version 2.1.0
thanks for your suggestion !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants