You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to RuntimeLibcalls.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:
Ah this is a great bug! ripgrep does actually know to stop respecting parent .gitignore once it crosses a repository boundary. The problem is that it's looking for a .gitdirectory:
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: