Skip to content

ripgrep complains about errors in .gitignore  #278

@rjsathome

Description

@rjsathome

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-*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions