ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.
http://geoff.greer.fm/ag/
Apache License 2.0
26.07k stars 1.42k forks source link

Glob pattern not matching as expected #881

Open ahw opened 8 years ago

ahw commented 8 years ago

With an ~/.agignore file whose content is the following, I expect to not get results from files ending in .map.

~/.aginore

*.map

And yet, I still see results from files with names like ReportIssueCommand.coffee.js.map. I.e., I see this in the console:

➜ cms-ui-article git:(report-issue) ✗ ag -l reportissue src/** src/common/commands/content/emailLink/ReportIssueCommand.coffee src/common/commands/content/emailLink/ReportIssueCommand.coffee.js.map src/common/commands/content/emailLink/ReportIssueCommand.coffee.js src/common/init/CommonCommandsInit.coffee src/common/init/CommonCommandsInit.coffee.js

However, I've noticed that if add *.coffee.js.map to the ~/.agignore file then it works as expected; when I change the ~/.agignore file to this:

~/.aginore

*.map
*.coffee.js.map

then I get this on the console (no more *.map files):

➜ cms-ui-article git:(report-issue) ✗ ag -l reportissue src/** src/common/commands/content/emailLink/ReportIssueCommand.coffee src/common/commands/content/emailLink/ReportIssueCommand.coffee.js src/common/init/CommonCommandsInit.coffee src/common/init/CommonCommandsInit.coffee.js

Maybe I can look into helping fix this myself, but wanted to file a bug in case others have been scratching their heads over this too.

JonRowe commented 8 years ago

I also experienced this, it's very confusing given the documentation claims to support the same file format as vcs ignore files. Would you mind if I updated the wiki to reflect this @ggreer?

erikrw commented 6 years ago

I also ran into this bug only minutes after installing ag. It would be nice with some indication of whether it is really considered a bug (and whether a pull request would be likely to be accepted)? @ggreer