-
-
Notifications
You must be signed in to change notification settings - Fork 661
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 git2 instead of parsing .gitignore for --git-ignore #653
Conversation
This is also an issue in Rust projects ( |
For some reason, it works for Anyway, there are others cases where git patterns are different than glob patterns; it’s just much more reliable and simpler to ask git to tell us what it is ignoring. |
This is fantastic! Thank you so much. |
Thanks, I’m proud of this code because I remember that it wasn’t an easy change. Glad it’s useful! |
This was an unintended consequence of #653. The Files iterator stopped using IgnoreCache and started using GitCache, which would always populated when the `--git` option was passed, without checking whether files were meant to be ignored. This meant that passing `--git` started ignoring files even without `--git-ignore`. The solution for now is to explicitly pass the flag around, which probably should be a better type than bool but isn't. This makes the git-ignoring-related extended tests pass.
I'm not sure if this is a bug or intended behavior, but |
Well, the current behavior is what’s documented: “ignore files mentioned in '.gitignore'.” I guess it would make sense to not show the If someone uses |
You're totally right. I checked my other CLI tools (fd, ripgrep, broot) and all of them behave exactly the same. I got confused because all of these tools ignore hidden files by default, and I forgot for a moment that I have my exa aliased with |
still node_modules is not ignored and there is no more --git-ignore option in 0.10.1 release? |
exa is unmaintained, please use the active fork eza (which has regular releases). Also see #1243 |
Fix #636
I can confirm that exa wasn’t able to hide a
node_modules
directory with a.gitignore
with the linenode_modules/
.Now, instead of using the glob crate to interpret the lines of
.gitignore
, exa uses part of the code that’s used to display the state of files in a repository.