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
Using double star at the front worked only with negation:
$ rg -g'**/test/' hello
No files were searched, which means ripgrep probably applied a filter you didn't expect. Try running again with --debug.
]$ rg -g'!**/test/' hello
foo/prod/bar/hello.txt
1:hello
In rg 0.8.1 this changed. Double star at the end doesn't work:
]$ rg -g'test/**' hello
No files were searched, which means ripgrep probably applied a filter you didn't expect. Try running again with --debug.
]$ rg -g'!test/**' hello
foo/test/bar/hello.txt
1:hello
foo/prod/bar/hello.txt
1:hello
Behavior of double star at the front didn't change.
Using double star on both sides, i.e., **/test/** works as expected in both versions.
Is that a bug? Or is **/test/** really the minimal correct pattern that can be simply negated with ! and work as expected?
The text was updated successfully, but these errors were encountered:
Yup, this is indeed correct. I'm not going to dig around for the specific change that caused this, but test/** should match test/foo but not bar/test/foo. It might make sense to add --include-dir or --exclude-dir flags as part of #809, but that isn't much shorter.
Or is **/test/** really the minimal correct pattern that can be simply negated with ! and work as expected?
I'm less sure about this. My thinking is that -g '*test*' should also work in this case, but it doesn't. However, this matches strictly more things than **/test/**. (*test* should match foo/atestb/bar where as **/test/** shouldn't.)
Up until rg 0.7.1, with the following file structure:
If I wanted to match (or exclude) specific dir anywhere in the file path I did:
Using double star at the front worked only with negation:
In rg 0.8.1 this changed. Double star at the end doesn't work:
Behavior of double star at the front didn't change.
Using double star on both sides, i.e.,
**/test/**
works as expected in both versions.Is that a bug? Or is
**/test/**
really the minimal correct pattern that can be simply negated with!
and work as expected?The text was updated successfully, but these errors were encountered: