-
-
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
./.gitignore: line 2: invalid use of **; must be one path component #373
Comments
Could you please provide a reproducible example? I can't reproduce it using the information you've given:
|
Closing due to inactivity. Please feel free to reopen with a repro. Thanks! |
@BurntSushi, ran into the same issue and isolated it with a mkdir scratch
cd scratch
echo '**.txt' > .gitignore
rg pattern receiving a |
Interesting. That isn't actually enough to reproduce the full issue, because it doesn't demonstrate that
But according to the specification that I actually implemented (see
I'm not sure what to do here. Either |
Had the same issue, I always thought git used
|
That particular piece seems fine. It looks like that's just stating support for |
Not sure about that one reading https://github.com/davvid/wildmatch/blob/350d6cde61cc901d4d22d60878dab445675fdd02/wildmatch/wildmatch.h#L55 But agreed, it's a documentation issue. But a quick search shows this sadly has always been an issue with gitignore even before wildmatch |
@derimagia Oh, I see, I still think this is unrelated to whether patterns like |
It looks like Side note, wildmatch was integrated in v1.8.2-rc0 and a prior tag (v1.8.1.6) reproduces the behavior of git to match Looks like the spec and implementation are just inconsistent...? |
Having this issue also. If I take out the line |
If I had to guess, yes? But nobody can say for sure, since the specification says that |
@BurntSushi imho it might be worth choosing consistency with implementation over spec in this case and making a prominent note of it |
@millerjs What are the semantics? Who is going to reverse engineer |
I'm going to close this because the current behavior is the conservative choice, and being conservative allows us to be flexible in the future. In particular, I think there is either a specification bug or an implementation bug in git, and I don't know which one it is. |
Could rg add an option to ignore this error? For example, |
You can basically say that about any particular flag. But if I add @Yggdroot Could you please say more about why the |
Error message is necessary. Up to now, the |
@Yggdroot Sorry, but I don't understand. Could you say more about why |
I mean the real error should be reported, it's necessary to see the reason why the error occurs, while with |
This stops ripgrep from complaining about invalid use of **; must be one path component See BurntSushi/ripgrep#373
This stops ripgrep from complaining about invalid use of **; must be one path component See BurntSushi/ripgrep#373
Same here. Workaround:
|
Current master has a |
I have sent an email to the Git mailing list requesting that the **.extension format be added to the documentation of Git ignore. I will update this issue when I have gotten a response. FYI, if anybody is using FZF.vim with |
It already has been. See the commit referenced in #1098 |
This is now fixed for good on master. ripgrep recognizes previously invalid |
**/something
is valid .gitignore syntax, but rg prints an errorThe text was updated successfully, but these errors were encountered: