-
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
rg does not ignore files listed in .git/info/exclude in git linked worktrees #1445
Comments
krobelus
added a commit
to krobelus/ripgrep
that referenced
this issue
Dec 11, 2019
Git looks for this file in GIT_COMMON_DIR, which is usually the same as GIT_DIR (.git). However, when searching inside a linked worktree, .git is usually a file that contains the path of the actual git dir, which in turn contains a file "commondir" which references the directory where info/exclude may reside, alongside other configuration shared across all worktrees. This directory is usually the git dir of the main worktree. Unlike git this does *not* read environment variables GIT_DIR and GIT_COMMON_DIR, because it is not clear how to interpret them when searching multiple repositories. Fixes BurntSushi#1445
BurntSushi
pushed a commit
that referenced
this issue
Feb 17, 2020
Git looks for this file in GIT_COMMON_DIR, which is usually the same as GIT_DIR (.git). However, when searching inside a linked worktree, .git is usually a file that contains the path of the actual git dir, which in turn contains a file "commondir" which references the directory where info/exclude may reside, alongside other configuration shared across all worktrees. This directory is usually the git dir of the main worktree. Unlike git this does *not* read environment variables GIT_DIR and GIT_COMMON_DIR, because it is not clear how to interpret them when searching multiple repositories. Fixes #1445, Closes #1446
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of ripgrep are you using?
ripgrep 11.0.2 (same in master I think)
How did you install ripgrep?
https://www.archlinux.org/packages/community/x86_64/ripgrep/
What operating system are you using ripgrep on?
Arch Linux
Describe your question, feature request, or bug.
If I exclude a file privately in
.git/info/exclude
, ripgrep ignores that file as expected - but only when searching inside the main worktree. In linked worktrees, the file is not ignored.If this is a bug, what are the steps to reproduce the behavior?
If this is a bug, what is the actual behavior?
If this is a bug, what is the expected behavior?
I think it should behave like
git ls-files; git ls-files --exclude-standard --others
:The text was updated successfully, but these errors were encountered: