-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
glob matching doesn't seem to work consistenly for plain directory match #1442
Copy link
Copy link
Closed
Labels
docAn issue with or an improvement to documentation.An issue with or an improvement to documentation.rollupA PR that has been merged with many others in a rollup.A PR that has been merged with many others in a rollup.
Description
What version of ripgrep are you using?
▶ rg --version
ripgrep 11.0.1
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
Compiled from source
What operating system are you using ripgrep on?
MacOS (Catalina)
Describe your question, feature request, or bug.
I think that passing a plain directory as argument to -g should match files in that directory. Moreover, prefixing a match string with ! should negate the results. This seems to the behaviour most of the time.
If this is a bug, what are the steps to reproduce the behavior?
## from temp, empty directory
mkdir a b
echo hello > a/test.txt
cp a/test.txt b
rg -g a hello ## return nothing
rg -g '!b' hello ## returns match from file in 'a'
If this is a bug, what is the actual behavior?
Above script yields following (showing output of negated search only)
▶ sh /tmp/run.sh
a/test.txt
1:hello
If this is a bug, what is the expected behavior?
Should have yielded results for either both or neither (preferably both) the invocations in the reproduction steps.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docAn issue with or an improvement to documentation.An issue with or an improvement to documentation.rollupA PR that has been merged with many others in a rollup.A PR that has been merged with many others in a rollup.