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

.gitignore entry ignored depending on path parameter #49

Closed
mengelbrecht opened this issue Sep 24, 2016 · 2 comments
Closed

.gitignore entry ignored depending on path parameter #49

mengelbrecht opened this issue Sep 24, 2016 · 2 comments
Labels
bug A bug.

Comments

@mengelbrecht
Copy link

Depending on the path parameter supplied to ripgrep on the commandline .gitignore patterns are ignored.

Setup:

$ mkdir -p test/foo/bar
$ touch test/foo/bar/baz
$ echo 'foo/bar' > test/.gitignore

When run with test as path parameter the bar directory is not ignored.

$ rg --debug --files "" test
DEBUG:grep::search: regex ast:
Empty
DEBUG:rg::ignore: test/.gitignore ignored because it is hidden
test/foo/bar/baz

When run inside test it is correctly ignored:

$ cd test
$ rg --debug --files ""
DEBUG:grep::search: regex ast:
Empty
DEBUG:rg::ignore: ./.gitignore ignored because it is hidden
DEBUG:rg::ignore: ./foo/bar ignored by Pattern { from: "./.gitignore", original: "foo/bar", pat: "foo/bar", whitelist: false, only_dir: false }
@BurntSushi
Copy link
Owner

I think this is a dupe of #25. I'll be sure to include your setup as a regression test.

@BurntSushi BurntSushi added the bug A bug. label Sep 24, 2016
@BurntSushi
Copy link
Owner

Actually, this is a dupe of #16. Fix incoming.

BurntSushi added a commit that referenced this issue Sep 24, 2016
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
amsharma91 added a commit to amsharma91/ripgrep that referenced this issue Sep 27, 2016
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 BurntSushi#16, BurntSushi#49, BurntSushi#50, BurntSushi#65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug.
Projects
None yet
Development

No branches or pull requests

2 participants