-
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 respect -F when used with -f #1176
Comments
Wow, what a terrible regression! I'm surprised we've gone this long without hearing about it. This is fixed on master. |
Fix confirmed ... thank you! And thanks again for the great tool. |
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?
$ rg --version
ripgrep 0.10.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
$ ripgrep/target/release/rg --version
ripgrep 0.10.0 (rev bf842db)
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
2 ways:
What operating system are you using ripgrep on?
macOS High Sierra, version 10.13.6 (17G3025)
Describe your question, feature request, or bug.
Even with -F option, rg attempts to interpret meta characters for patterns supplied in a file.
If this is a bug, what are the steps to reproduce the behavior?
Create a simple test file containing meta characters
% echo 'not a (cloud) in the sky' > test.txt
Searching the file using the file itself as a fixed pattern doesn't find a match.
% rg -F -f test.txt test.txt
[no output]
But, searching the file with the fixed pattern specified on the command line does find a match (as desired).
% rg -F 'not a (cloud) in the sky' test.txt
I believe that the first search should produce the same result as the second one.
If this is a bug, what is the actual behavior?
$ rg --debug -F -f test.txt test.txt
$ rg --debug -F 'not a (cloud) in the sky' test.txt
If this is a bug, what is the expected behavior?
When both -F (or --fixed-strings) and -f (or --file) are given, rg should not attempt to interpret any meta characters in the PATTERNFILE.
For reference, the macOS default grep and GNU grep (installed via homebrew) give the expected result. (But are not nearly as fast as ripgrep for many of my tasks; thank you for a fantastic tool!)
$ grep -F -f test.txt test.txt
$ grep -V
$ ggrep -F -f test.txt test.txt
$ ggrep -V
The text was updated successfully, but these errors were encountered: