-
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
Don’t use .gitignore of a different git repository #893
Labels
bug
A bug.
Comments
Ah this is a great bug! ripgrep does actually know to stop respecting parent Line 257 in 6b15ce2
But it looks like |
Indeed, it looks like |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a clone of https://github.com/rust-lang/rust with git submodules checked out, in the
src/llvm
submodule, ripgrep 0.8.1 seems to "miss" several results that are found by GNU grep or git-grep:This turns out to be because of the
.gitignore
file at the root of the Rust repository. Running with--no-ignore-parent
makes it find those extra results.These files are not ignored by git. If I modify
~/rust/src/llvm/include/llvm/CodeGen/RuntimeLibcalls.def
for example,git status
will show it as modified. My understanding is that~/rust/.gitignore
is not relevant toRuntimeLibcalls.def
because it belongs to a different repository. This is detected by the presence of a.git
directory (or file) at~/rust/src/llvm/.git
.When going up the parent/ancestor directories, ripgrep should probably stop considering
.gitignore
files after it goes beyond the root of a git repository (as indicated by.git
). Conversely, when descending into a directory that contains.git
, it should maybe stop considering.gitignore
files that are "above" this directory.The text was updated successfully, but these errors were encountered: