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 rule path/*.js is not respected #1368

Open
kuba-orlik opened this issue Mar 19, 2020 · 3 comments
Open

.gitignore rule path/*.js is not respected #1368

kuba-orlik opened this issue Mar 19, 2020 · 3 comments

Comments

@kuba-orlik
Copy link

ag still looks inside files that are ignored in .gitignore with a rule like so:

src/*.js
/tmp/projectile-repro >>> cat .gitignore
src/*.js
/tmp/projectile-repro >>> ag testing
src/file.js
1:"testing"
@smolyn
Copy link

smolyn commented Jun 9, 2020

I'm also seeing this behaviour. It also failing with **, ie. a/**/*.js

@smolyn
Copy link

smolyn commented Jun 9, 2020

Interesting debug output, here's what I'm seeing.
I have these two rules:

www/yarn-error.log
www/src/**/*.map

In the debug output, I see these lines:

DEBUG: pattern www/yarn-error.log doesn't match path www/src/pages/ViewPage.js.map
DEBUG: pattern www/src/**/*.map doesn't match file ViewPage.js.map

For the first pattern it is including the path part of the file, but for some reason the second one it is only reporting the filename, not including the path.

However, it should match with the path, and thus be excluded (but it is not).

@smolyn
Copy link

smolyn commented Jun 9, 2020

Looking at ignore.c line 276, it only passes in the filename, not the full path+filename, to the regex matcher.
There looks to be a few other places where that is happening -- I'm guessing the ignore code does not work well with paths.

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