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
I'll call this a bug since it doesn't match what git does, but I'm not sure ripgrep will ever have precisely the same semantics as the globs supported by git.
I haven't investigated this one in particular. It's possible there's an easy fix. If so, patches are welcome.
I thought the example you provided was interesting.
Through analysis and test, I think "* [\ <, > : " \ / \ ? \ | \ \ ] * " actual effect in the git ignore behavior content, can be simplified as "[\/]". (Because of the character in [], only one character takes effect at the end.)
In fact, it is "[/]*" , and when "/" appears in "[]", it affects the judgment of git and rg, causing them to ignore the behavior is inconsistent.
However, when git and rg do not behave in the same way, it is not necessarily a problem with rg and we need to experiment further.
Analysis of results:
Experiment 1: folder2 was consistent in its performance and was not ignored. folder1 is not ignored in git, it is ignored in rg. git and rg behave differently here. git's behavior should be reasonable, does rg need to fix this problem? @BurntSushi
Experiment 2: folder2[/], folder3/, according to the regular expression expansion, the theoretical logic should be the same, but here actually folder2 is not ignored in the end, folder3 is ignored. I feel that there may be a problem with git's judgment logic, and it may be necessary for someone involved in git to look at this issue.
Please tick this box to confirm you have reviewed the above.
What version of ripgrep are you using?
ripgrep 14.1.0 (rev e50df40)
features:-simd-accel,+pcre2
simd(compile):+SSE2,-SSSE3,-AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PCRE2 10.42 is available (JIT is available)
How did you install ripgrep?
Github release
ripgrep_14.1.0-1_amd64.deb
What operating system are you using ripgrep on?
WSL2: Ubuntu (Linux x64 5.10.102.1-microsoft-standard-WSL2)
Describe your bug.
Ripgrep doesn't interpret
*[\<\>\:\"\/\\\|\?\*]*
in.gitignore
in the same way that git does.What are the steps to reproduce the behavior?
where the gitignore contains the following:
git init
git status
-> notice that no files are ignored by git.rg --files
-> notice that onlyfoo.txt
is picked up, notbar.txt
.What is the actual behavior?
What is the expected behavior?
ripgrep should have returned:
The text was updated successfully, but these errors were encountered: