-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add flag to specify one or more additional ignore files #45
Comments
Hmm. Would you be opposed to this going in |
I am on RHEL6.6 and
Also this is work machine.. so I don't have admin rights. Do we have an xdg alternative in that case? |
Sorry, by |
Hmm, I symlinked
|
Well, |
Ah OK, that would work as long as I can maintain just one common global ignore file :) Thanks! |
Here's another idea to implement the same. I like it better because then I use an alias to have the complete How about having a switch named
|
When you say "Read the ignore file before reading .ignore .gitignore in current or parent directories," do you mean that |
No, here was my thinking.. Let's use we did
Suppose we had a
Then if So, read first implies open to be overridden. |
@kaushalmodi Hmm, yes, I see, I think those semantics makes sense. |
FWIW the_silver_searcher uses |
Allowing multiple |
@kaushalmodi I definitely like the idea of |
Absolutely! Then I need to simply add that to my alias and then it becomes as good as a global ignore file. What's even better is that I can have more than one global ignores.. one that is central to the whole project, others which could be user-specific. |
Perfect. Much easier to implement. Hopefully tonight. :-) |
Thanks! Just to confirm that they will have the lowest priority when compared with the ones in the current/parent directories as in my example above, correct? |
Yes. The terminology I'd like to use is "precedence." That is, ignore files specified via --ignore-file have a lower precedence than any other ignore file. That means a whitelisted pattern in an ignore file in a directory will override an ignore pattern in an --ignore-file. |
This is slightly trickier than I thought and probably exceeds my budget for middle-of-the-week work unfortunately. The issue is that every ignore file needs to interpret paths relative to itself (these are the semantics of |
I hope that the overhaul in the globbing code now makes it possible to implement this. |
No. The ignore code and the glob code are related but distinct. Sorry. Refactoring the ignore code is pretty high on my list because I hope to get perf gains out of it. I just got married. I'll get to this when I can. |
Understood. Congratulations! :) |
This PR introduces a new sub-crate, `ignore`, which primarily provides a fast recursive directory iterator that respects ignore files like gitignore and other configurable filtering rules based on globs or even file types. This results in a substantial source of complexity moved out of ripgrep's core and into a reusable component that others can now (hopefully) benefit from. While much of the ignore code carried over from ripgrep's core, a substantial portion of it was rewritten with the following goals in mind: 1. Reuse matchers built from gitignore files across directory iteration. 2. Design the matcher data structure to be amenable for parallelizing directory iteration. (Indeed, writing the parallel iterator is the next step.) Fixes #9, #44, #45
Fixed in #202. |
@BurntSushi I think it's unfortunate that there's no way (?) to get the behaviour you proposed but ultimately decided against:
Would you be open to making something possible here? If so, which issue do I open - 'parse env vars in ripgreprc', or 'revisit global ignore file'? 🙂 NB: another (probably simpler) approach could be to allow relative (to the
(edit: when I say 'no way', I suppose I mean 'with static config files' - obviously I could have my |
Hello,
This might be a feature borrowed from
ag
.It is very convenient to have a global
~/.rgignore
that applies everywhere. It would contain stuff like:Then, even if I am working in
/proj/SOMEPRJ/
and if I have/proj/SOMEPRJ/.rgignore
, then theSOMEPRJ
specific.rgignore
+~/.rgignore
, both will be respected.That way I do not copy the common stuff in the
.rgignore
of all the projects. Note that~
(or/home/$USER
) and/proj/SOMEPRJ/
do not share the same parent dir.The text was updated successfully, but these errors were encountered: