-
-
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
$HOME/.gitignore is incorrectly used when searching in other directories such as /tmp #934
Comments
Hmm, I can't seem to reproduce this issue on master:
|
How do I install master?
|
I can't reproduce this in Do you have any global git configuration set? For example, if you have
to my
where my
This does actually seem like a bug to me. I don't think ripgrep should be applying global gitignore rules outside of a git repo. |
The README has build instructions. But given my previous comment, I don't think it's necessary, assuming the issue here is indeed your global git config. |
@BurntSushi awesome catch!
I also have a ton of I also don't recalled why this is set in |
Even inside a git repo, this might be confusing for the same reasons that led me to use |
This commit adds a new --no-ignore-global flag that permits disabling the use of global gitignore filtering. Global gitignores are generally found in `$HOME/.config/git/ignore`, but its location can be configured via git's `core.excludesFile` option. Closes #934
This bug is fixed on master, and @roblourens I've added a new |
Thanks @BurntSushi ! |
Thanks, reopening the vscode issue to use it. |
In case anyone else lands here and was using this as a "feature" (with apologies for the xkcd.com/1172/): I had been using this bug to add a local |
This flag prevents ripgrep from requiring one to search a git repository in order to respect git-related ignore rules (global, .gitignore and local excludes). This actually corresponds to behavior ripgrep had long ago, but #934 changed that. It turns out that users were relying on this buggy behavior. In most cases, fixing it as simple as converting one's rules to .ignore or .rgignore files. Unfortunately, there are other use cases---like Perforce automatically respecting .gitignore files---that make a strong case for ripgrep to at least support this. The UX of a flag like this is absolutely atrocious. It's so obscure that it's really not worth explicitly calling it out anywhere. Moreover, the error cases that occur when this flag isn't used (but its behavior is desirable) will not be intuitive, do not seem easily detectable and will not guide users to this flag. Nevertheless, the motivation for this is just barely strong enough for me to begrudgingly accept this. Fixes #1414, Closes #1416
This flag prevents ripgrep from requiring one to search a git repository in order to respect git-related ignore rules (global, .gitignore and local excludes). This actually corresponds to behavior ripgrep had long ago, but #934 changed that. It turns out that users were relying on this buggy behavior. In most cases, fixing it as simple as converting one's rules to .ignore or .rgignore files. Unfortunately, there are other use cases---like Perforce automatically respecting .gitignore files---that make a strong case for ripgrep to at least support this. The UX of a flag like this is absolutely atrocious. It's so obscure that it's really not worth explicitly calling it out anywhere. Moreover, the error cases that occur when this flag isn't used (but its behavior is desirable) will not be intuitive, do not seem easily detectable and will not guide users to this flag. Nevertheless, the motivation for this is just barely strong enough for me to begrudgingly accept this. Fixes #1414, Closes #1416
What version of ripgrep are you using?
How did you install ripgrep?
What operating system are you using ripgrep on?
mac 10.13.4
Describe your question, feature request, or bug.
Create a
.gitignore
in your$HOME
directory. Cd over to/tmp
, mkdir a pattern excluded in.gitignore
and executerg
.If this is a bug, what are the steps to reproduce the behavior?
If this is a bug, what is the actual behavior?
See above.
If this is a bug, what is the expected behavior?
ripgrep should not use .gitignore in your $HOME directory when searching in other directories such as
/tmp
The text was updated successfully, but these errors were encountered: