-
-
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
support empty alternate glob patterns #1368
Comments
Possibly related to globbing behavior mentioned in #1221 ? |
That ticket seems only tangentially related. I think your problem here is related to the fact that ripgrep just drops empty alternates, so where you're expecting for example |
This syntax does not exist in `git`, so it is not documented in `man gitignore`. There is a question of whether it *should* exist, but as long as it does, it should be documented somewhere. See also: BurntSushi#1221 BurntSushi#1368
Add a method GlobBuilder::empty_alternates and supporting mechanisms. related to BurntSushi#1368
What version of ripgrep are you using?
How did you install ripgrep?
Installed with cargo
What operating system are you using ripgrep on?
Windows 8.1 Pro (x86_64)
If it's relevant, I'm also using the latest version of msys2-x86_64
Describe your question, feature request, or bug.
Bash and ripgrep evaluate globs differently, which seems like a bug to me.
If this behavior is actually intended, I'd like help finding a glob pattern that will give the result bash does for my test pattern.
If this is a bug, what are the steps to reproduce the behavior?
In a directory I have 5 files containing only the string 'qwertyuiop'
The files are named:
'.foo' '.foo_baz' 'bar.foo' 'baz.foo_bar' 'SHOULD_NOT_BE_GLOBBED'
I do not have any .ignore-like files, am not instructing ripgrep to use a configuration file, and have not set
RIPGREP_CONFIG_PATH
The glob pattern I am using for this test is
{*,}.foo{_*,}
The regex is simply "\D", which should match every character in the 5 files
If this is a bug, what is the actual behavior?
See https://gist.github.com/StaticPH/c52d9ddee8a1a43a23196f5f46f1503e
If this is a bug, what is the expected behavior?
Simply calling
echo {*,}.foo{_*,}
in bash prints outbaz.foo_bar bar.foo .foo_baz .foo
, so I would have expected bothto output
and for
to output
The text was updated successfully, but these errors were encountered: