ggreer / the_silver_searcher

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

-g PATTERN does not use any ignore options #904

Open sasq64 opened 8 years ago

sasq64 commented 8 years ago

When looking for files only using '-g', no ignore options are used (including .agignore, .gitignore and the --ignore option) Maybe this is by design? However it would be very useful, since ag is commonly used to get a list of all files to index/search for a project, and then you really want to use .gitignore.

Using version 0.31.0

Issue #442 (fixed) mentions the "-g" option -- but seems to have been a general problem

sasq64 commented 8 years ago

Ok so investigated this a bit more and the problem happens only for files I specified as *.ext which does not ignore files that for instance match *.something.ext

So it seems the glob matching in ag here is not compatible with .gitignore ?

For instance, putting *.o in .gitignore will ignore myfile.o but not myfile.cpp.o

Workaround for me is to replace all *.o with *\.o in my .gitignore files