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

Use $XDG_CONFIG_HOME/git/ignore as the default global .gitignore #212

Closed
mrymtsk opened this issue Mar 7, 2020 · 5 comments
Closed

Use $XDG_CONFIG_HOME/git/ignore as the default global .gitignore #212

mrymtsk opened this issue Mar 7, 2020 · 5 comments

Comments

@mrymtsk
Copy link

mrymtsk commented Mar 7, 2020

Describe the bug
Broot currently refers to the file specified in core.excludesFile variable of the global git config as the global .gitignore. However, it is stated in the documentation that $XDG_CONFIG_HOME/git/ignore (or $HOME/.config/git/ignore if $XDG_CONFIG_HOME is not set) is the default value of core.excludesFile. It would be nice if broot refers to $XDG_CONFIG_HOME/git/ignore when core.excludesFile is not set.

To Reproduce

  1. Create $XDG_CONFIG_HOME/git/ignore with * (ignores all) as the content.
  2. Remove core.excludesFiles variable from the global git config.
  3. Go to any git repository.
  4. broot -I to see that files are not ignored.

Expected behavior
All files are expected to be ignored in the above case.

Configuration (please complete the following information):

  • OS: macOS
  • Version: broot 0.13.2
@Canop
Copy link
Owner

Canop commented Mar 14, 2020

The specification says:

Patterns which a user wants Git to ignore in all situations (e.g., backup or temporary files generated by the user’s editor of choice) generally go into a file specified by core.excludesFile in the user’s ~/.gitconfig. Its default value is $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/ignore is used instead.

I think it means the correct behavior is to use the core.excludesFile git configuration variable, which is what broot does.

@mrymtsk
Copy link
Author

mrymtsk commented Mar 16, 2020

Yes that is the correct behavior, but I meant that broot can use $XDG_CONFIG_HOME/git/ignore (or $HOME/.config/git/ignore) as the global .gitignore when core.excludesFile is not set, just as git does.

@Canop Canop closed this as completed in b8bc0b5 Mar 19, 2020
@rlue
Copy link

rlue commented Jan 1, 2021

Not sure if this is related or if it deserves a new issue, but I've explicitly set core.excludesFile and still seeing files in broot that are explicitly ignored:

# ~/.config/git/config
[core]
	excludesFile = ~/.config/git/ignore
# ~/.config/git/ignore
/tags

Even with this, br still shows tags files in the current directory with gi:y. Am I missing something or doing something wrong? Should I open a new issue? Can we reopen this one?

@Canop
Copy link
Owner

Canop commented Jan 1, 2021

@rlue this looks like a different issue. I suspect the / in /tags isn't understood by broot to be the current repository. Can you create the issue ?
(if you don't create it I'll do it when I have some time for the checks)

@rlue
Copy link

rlue commented Feb 8, 2021

Sorry it took so long to follow up. I see that you created #321 for this. Thanks so much! 🙇

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

No branches or pull requests

3 participants