Skip to content
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

Ripgrep does not support ** in .gitignore files #1080

Closed
RedX2501 opened this issue Oct 8, 2018 · 2 comments
Closed

Ripgrep does not support ** in .gitignore files #1080

RedX2501 opened this issue Oct 8, 2018 · 2 comments
Labels
duplicate An issue that is duplicative of another.

Comments

@RedX2501
Copy link

RedX2501 commented Oct 8, 2018

What version of ripgrep are you using?

ripgrep 0.10.0 (rev 8a7db1a)
-SIMD -AVX (compiled)

How did you install ripgrep?

Github binary release

What operating system are you using ripgrep on?

Windows within bash provided with git (msys environment)

Describe your question, feature request, or bug.

In windows .gitconfig can contains ** in paths. Example:

doc**/

If this is a bug, what are the steps to reproduce the behavior?

Run command

rg unfindable

If this is a bug, what is the actual behavior?

Currently I get the following error:

./.git/info/exclude: line 12: error parsing glob 'doc**/': invalid use of **; must be one path component
./.git/info/exclude: line 13: error parsing glob 'Release**/': invalid use of **; must be one path component

If this is a bug, what is the expected behavior?

Support this pattern (at least on windows)

This pattern is even (documented)[https://git-scm.com/docs/gitignore#_pattern_format]

@BurntSushi
Copy link
Owner

ripgrep does support **. The error message is telling you exactly what the problem is: use of ** must be one path component. Indeed, the documentation you linked to explicitly says this:

  • A leading ** followed by a slash means match in all directories. For example, **/foo matches file or directory foo anywhere, the same as pattern foo. **/foo/bar matches file or directory bar anywhere that is directly under directory foo.

  • A trailing /** matches everything inside. For example, abc/** matches all files inside directory abc, relative to the location of the .gitignore file, with infinite depth.

  • A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, a/**/b matches a/b, a/x/b, a/x/y/b and so on.

  • Other consecutive asterisks are considered invalid.

Otherwise, this is a duplicate of #373.

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Oct 8, 2018
@RedX2501
Copy link
Author

RedX2501 commented Oct 9, 2018

I completely agree with you. Yet git does not complain on windows. I'll see if chaning the pattern produces the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another.
Projects
None yet
Development

No branches or pull requests

2 participants