-
-
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
Restricting directories leads gitignore to be interpreted too strongly #2498
Comments
So I can't quite tell which bug is being reported here. Could you say what the expected output of each Basically:
|
FTR, the same happens if you do The behaviour I expect is that ripgrep is consistent with git, and consistent with itself. If you don't restrict the directories, it works fine, see output above. I guess one workaround would be to turn the |
Can you clarify the expected output for each of your |
Actual output:
Expected output:
|
All righty, thanks. I suspect this is a duplicate, but I don't have the context paged into cache to know for sure. It does look like a ripgrep bug. (I sadly don't expect this to get fixed any time soon because I don't expect this to get fixed until |
Hmm yeah it seems a lot like a dupe of #278. Closing. |
oh I've checked rustc's gitignore, it seems to indeed be a case of #1050 -- the build dir is negatively exempted from the "build should be ignored" rule in gitignore. That's why it work in git... |
What version of ripgrep are you using?
What operating system are you using ripgrep on?
NixOS 22.11 Raccoon
Describe your bug.
Ripgrep ignores some files through .gitignore that git doesn't ignore.
What are the steps to reproduce the behavior?
As you can see, ripgrep doesn't traverse into the
build/
directory, but only if its directory is restricted. I'd put this on .gitignore containingbuild/
and ripgrep interpreting that too strongly.git has no problems with the gitignore file, when you do:
git adds that new file.
git behaviour is a bit weird here because
build/
is meant to apply to all directories, including non-top-level ones. I'm not sure what the logic in git is but for ripgrep it was a bit unexpected for me. Btw, the file does show up in vscode's search even if you restrict yourself tocompiler/
.The text was updated successfully, but these errors were encountered: