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 complains about errors in .gitignore #278

Open
rjsathome opened this issue May 4, 2018 · 0 comments
Open

ripgrep complains about errors in .gitignore #278

rjsathome opened this issue May 4, 2018 · 0 comments

Comments

@rjsathome
Copy link

Just tried a new tool (https://github.com/BurntSushi/ripgrep) and found:

(1)$ rg foobar
./.gitignore: line 26: error parsing glob '**.war': invalid use of ; must be one path component
./.gitignore: line 64: error parsing glob '
.orig': invalid use of ; must be one path component
./.gitignore: line 79: error parsing glob '
.swp': invalid use of **; must be one path component

From the gitignore man-page:

Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning:

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.

So I think these entries in .gitignore should be changed to

(1)$ git diff .gitignore
diff --git a/.gitignore b/.gitignore
index b11c4dbd..b545f7c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,7 @@ db/*.sqlite3
 /tmp/*

 # various artifacts
-**.war
+*.war
 *.rbc
 *.sassc
 .rspec
@@ -61,7 +61,7 @@ pickle-email-*.html
 # Here are some files you may want to ignore globally:

 # scm revert files
-**.orig
+*.orig

 # Mac finder artifacts
 .DS_Store
@@ -76,7 +76,7 @@ pickle-email-*.html
 /*.tmproj

 # vim artifacts
-**.swp
+*.swp

 # Sublime project files
 *.sublime-*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant