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

On .gitignore error handling #945

Closed
gcp opened this issue Jun 12, 2018 · 2 comments
Closed

On .gitignore error handling #945

gcp opened this issue Jun 12, 2018 · 2 comments
Labels
duplicate An issue that is duplicative of another.

Comments

@gcp
Copy link

gcp commented Jun 12, 2018

What version of ripgrep are you using?

ripgrep 0.8.1
-SIMD -AVX

How did you install ripgrep?

cargo

What operating system are you using ripgrep on?

Linux (Ubuntu 16.04)

Describe your question, feature request, or bug.

Using ripgrep over the entire Android AOSP tree produces quite a few errors parsing .gitignore files. There's 2 concerns with this: 1) when using ripgrep, I don't really care about its opinion on the .gitignore files of another project 2) I'm assuming this means there's a behavior difference between real git and ripgrep's gitignore parsing.

Examples:

./external/glide/.gitignore: line 24: error parsing glob '**local.properties': invalid use of **; must be one path component

./external/chromium-trace/catapult/telemetry/bin/.gitignore: line 2: error parsing glob '!**.sha1': invalid use of **; must be one path component

I'm not sure what the correct solution here should be, but these error messages are not useful and obscure the real output.

@okdana
Copy link
Contributor

okdana commented Jun 12, 2018

You can silence the error messages with the --no-messages flag. To make the effect permanent you can add the option either to a shell alias or to your config file.

As far as behaviour differences, it does appear that git (2.17.1) accepts both of those patterns (confirmed via git status and git check-ignore), even though the documentation explicitly states that ** is invalid unless preceded and/or followed by a slash. 🤷‍♀️

@BurntSushi
Copy link
Owner

This same issue has been filed several times: #373, #646, #507, #859. The first one in particular contains the most discussion.

Current master has a --no-ignore-messages flag, which suppresses exactly these error messages.

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Jun 12, 2018
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

3 participants