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 handling of overlapping patterns is inconsistent with git #67

Closed
bennofs opened this issue Sep 24, 2016 · 1 comment
Closed

Comments

@bennofs
Copy link

bennofs commented Sep 24, 2016

Git allows the following in a .gitignore:

/*
!/dir

which means: ignore every directory in the root of the repository except the dir directory. Git understands this, but rg will fail to find results in /dir. Note that pt handles this correctly.

@BurntSushi
Copy link
Owner

BurntSushi commented Sep 25, 2016

Thanks for the report! This wasn't actually a bug with overlapping patterns or anything. There was a bug in the gitignore parser that was triggered by the whitelist that was preventing /dir from being interpreted as an anchored path.

amsharma91 added a commit to amsharma91/ripgrep that referenced this issue Sep 27, 2016
There was a bug in the translation from a gitignore pattern to a standard
glob where `!/dir` wasn't being interpreted as an absolute path.

Fixes BurntSushi#67.
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

2 participants