-
-
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
document the difference between -tmd and -g*.md #1635
Comments
.gitignore
rg --glob
does not respects .gitignore
Thank you for the detailed bug report, but this is correct behavior. Glob overrides always have the highest precedent. So if you use Interestingly, the same is not true for file types. If you use This does seem like something that the docs could be more explicit about, so I'll mark this as a doc bug. |
rg --glob
does not respects .gitignore
Hi I knew about Not complaining, but I thought rg followed the behavior of
If I am mistaken, I request you to reconsider this as by this we could support random extensions and also respect Also please see the following, when I modified .gitignore (Is this consistent with your comment? I am not sure.): Test-Glob() {
mkdir -p Temp
cd Temp || exit
git init > /dev/null
echo '/**/.Commit/**' > .gitignore
mkdir -p a/.Commit && touch a/.Commit/a.md
touch a/a.md
echo "PWD= ${PWD}"
echo "${Blue:=}------------Cat gitignore--------------------${Normal:=}"
cat .gitignore
echo "${Blue:=}------------List files not ignored--------------------${Normal:=}"
git check-ignore -v ./**/*
echo "${Blue:=}------------Find--------------------${Normal:=}"
find . -type f -name "*.md"
echo "${Blue:=}------------Ripgrep Glob--------------------${Normal:=}"
rg --glob "*.md" --files
echo "${Blue:=}------------Ripgrep--------------------${Normal:=}"
rg --files
cd ..
}
|
It does. The fact that rules in a
No, the behavior isn't changing. It would be a breaking change that feels big enough to me that I'm not comfortable with it, and while I see that there are problems with the current behavior, there would also be problems with your proposed behavior. Ultimately, I judged that the status quo was the least bad option and went with that.
Yes, because
|
Sorry for the confusion: I am really not sure why
What i understood (from your comments): If glob finds Going by this explanation, if glob overrides always has the highest precedent, then rg should also print |
It has to descend into the directory in the first place. Look at the This is why I wrote, "and ripgrep would otherwise descend into the directory." |
What version of ripgrep are you using?
ripgrep 12.0.1
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
linuxbrew
What operating system are you using ripgrep on?
Ubuntu 20.04
Describe your bug.
rg does not respects
.gitignore
. See example below:What is the actual behavior?
What is the expected behavior?
rg should ignore
./a/.Commit/a.md
The text was updated successfully, but these errors were encountered: