-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Disable .gitignore files by default, only use .ignore files? #645
Comments
Hiya! In today's ripgrep, other than Note that it will be interesting to see whether such a rule causes ripgrep to run more slowly on your repo. If your gitignore files are already extensive, then my guess is no, but it's worth checking just in case. With that said, to respond more generally:
The other solution that I don't think you mentioned is to add explicit whitelists for files that are tracked by git but would otherwise be ignored. My guess is that you've already considered that solution and ruled it out. :-) |
Thanks! Looks like Is the exact syntax for |
Looking at Having this |
Also, for anyone who stumbles on this in the future:
Yeah, the problem is not with building that list of files (Mercurial makes it really easy to figure that out: |
@Sid0 Here's an example that shows the difference between
Now change
It should be the same as
Yeah that'd be neat. 33% is quite amazing. Your I'm personally unlikely to implement said optimization because I do still consider
Interesting! My mind has trouble thinking at that level of development scale. Pretty neat tidbit, thanks! My feeling is that this particular issue can be closed, where the |
Ah, looks like it works for hidden files in the top level but not in subdirectories (try adding e.g. |
@Sid0 Ah right yeah, if a glob doesn't contain a |
Thanks then! |
@Sid0 I forgot to update this issue. The latest release of ripgrep now has a |
Hi there,
UPD: I ended up with explicitly specifying glob to exclude: since it looks like --ignore-vcs is overridden by --hidden |
@tagwint You might consider reading the GUIDE for help on how to deal with filtering. Improvements are welcome to the guide to make things clearer. To answer your question, just add
|
Thanks for suggestion, @BurntSushi |
ref. BurntSushi/ripgrep#645 (comment) Signed-off-by: flavono123 <flavono123@gmail.com>
Hi! Does ripgrep provide a way to disable gitignore parsing by default and only rely on
.ignore
files?Some surrounding context:
We've deployed ripgrep to thousands of developers at Facebook and people really love it overall. But we have thousands of files that are tracked but match ignore rules, and ripgrep skips over those files by default.
(Facebook uses Mercurial, but for various reasons the source of truth for ignore rules is still gitignores. We have a script that reads a repo with gitignores and generates a set of hgignores to go along with it. This shouldn't be relevant to the rest of the discussion.)
There's a fundamental incompatibility between the way ripgrep looks at ignore rules and the way VCS systems look at ignore rules.
.gitignore
(and.hgignore
,.svnignore
etc) only applies to files not already tracked by the VCS. But since ripgrep is unaware of what files are tracked by the VCS, it applies gitignore rules to all files including tracked ones.At Facebook we have thousands of files that are tracked but match ignore rules, and ripgrep skips over them by default. I would be very surprised if other repos (especially large ones) wouldn't hit the same issue.
It would be great if we could maintain a separate list of rules in
.ignore
and then haverg
not try and read.gitignore
rules at all. Even better if this could be configured per-repository, but a global config would also be OK.I guess we could deploy
rg
as a shell script that calls the actualrg
binary with--no-ignore-vcs
, but then sometimes people do want to apply the ignore rules and there doesn't appear to be a--ignore-vcs
flag.The text was updated successfully, but these errors were encountered: