You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that specifying a path in a .gitignore which has a trailing slash, such as
a/
(as opposed to simply a) causes rg --files to fail to correctly ignore files within that directory. This only happens when an absolute path is supplied as an argument.
Steps to reproduce
Here's a shell session that shows the problem. In it I create a directory, ignore it, and then show that the files within that directory are correctly ignored if I run rg --files or rg --files ignored . (see #64 for why I've included the word ignored in that invocation), but not if I run rg --files ignored $PWD.
If I either specify the path as ., or remove the trailing slash from the line in .gitignore, the directory is correctly ignored.
$ uname -mrsv
Darwin 15.6.0 Darwin Kernel Version 15.6.0: Mon Aug 29 20:21:34 PDT 2016; root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64
$ rg --version
0.1.17
$ mkdir a
$ touch x y a/x a/y
$ echo a/ > .gitignore
$ ag . -l -g ''
x
y
$ ag $PWD -l -g ''
/Users/redacted/mess/current/example/x
/Users/redacted/mess/current/example/y
$ rg --files ignored .
./x
./y
$ rg --files ignored $PWD
/Users/redacted/mess/current/example/a/x
/Users/redacted/mess/current/example/a/y
/Users/redacted/mess/current/example/x
/Users/redacted/mess/current/example/y
$ echo a > .gitignore
$ rg --files ignored .
./x
./y
$ rg --files ignored $PWD
/Users/redacted/mess/current/example/x
/Users/redacted/mess/current/example/y
The text was updated successfully, but these errors were encountered:
We were erroneously neglecting to prefix a pattern like `foo/`
with `**/` (to make `**/foo/`) because it had a slash in it. In fact, the
only reason to neglect a **/ prefix is if the pattern already starts
with **/, or if the pattern is absolute.
Fixes#16, #49, #50, #65
We were erroneously neglecting to prefix a pattern like `foo/`
with `**/` (to make `**/foo/`) because it had a slash in it. In fact, the
only reason to neglect a **/ prefix is if the pattern already starts
with **/, or if the pattern is absolute.
FixesBurntSushi#16, BurntSushi#49, BurntSushi#50, BurntSushi#65
It seems that specifying a path in a
.gitignore
which has a trailing slash, such as(as opposed to simply
a
) causesrg --files
to fail to correctly ignore files within that directory. This only happens when an absolute path is supplied as an argument.Steps to reproduce
Here's a shell session that shows the problem. In it I create a directory, ignore it, and then show that the files within that directory are correctly ignored if I run
rg --files
orrg --files ignored .
(see #64 for why I've included the wordignored
in that invocation), but not if I runrg --files ignored $PWD
.If I either specify the path as
.
, or remove the trailing slash from the line in.gitignore
, the directory is correctly ignored.The text was updated successfully, but these errors were encountered: