Open skrattaren opened 7 years ago
…and in 2.0 there seems to be no way at all to keep global ignore file =(
For me in 2.0, ~/.agignore works
when just ~/.ignore
does not.
$ ls -la ~ | ag ignore
lrwxr-xr-x 1 x staff 21 Jun 15 11:38 .agignore -> /Users/207383/.ignore
lrwxr-xr-x 1 x 1490099278 27 Jun 7 2016 .gitignore_global -> .dotfiles/.gitignore_global
-rw-r--r-- 1 x 1490099278 27 May 31 2016 .hgignore_global
lrwxr-xr-x 1 x 1490099278 17 Oct 20 2016 .ignore -> .dotfiles/.ignore
$ ag 'ignore' ~/.gitignore_global ~/.hgignore_global
$ ag --version
ag version 2.0.0
Features:
+jit +lzma +zlib
I'm on OSX and for me ~/.agignore works and ~/.ignore does not.
ag 2.1.0
$ uname -mrv
18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64
$ ag --version
ag version 2.2.0
Features:
+jit +lzma +zlib
$ stat -f "%a %m %c" .ignore
1558601129 1558601015 1558601015
$ stat -f "%a %m %c" .agignore
1558601015 1558600467 1558600467
$ ag SearchBar > /dev/null
$ stat -f "%a %m %c" .ignore
1558601644 1558601015 1558601015
$ stat -f "%a %m %c" .agignore
1558601015 1558600467 1558600467
$ rm .ignore
$ stat -f "%a %m %c" .agignore
1558601015 1558600467 1558600467
$ ag SearchBar > /dev/null
$ stat -f "%a %m %c" .agignore
1558601015 1558600467 1558600467
It seems .ignore
is used, and .agignore
is never used on Mac OS.
I think only ./.ignore
is being used. ~/.ignore
is not being used at all. I'm having to resort to alias ag='ag --path-to-ignore ~/.ignore'
for it to work.
Documentation here: https://github.com/ggreer/the_silver_searcher/wiki/Advanced-Usage#ignoring-files
The .agignore file was removed in favor of .ignore as part of the 2.0.0 release.
Ah @kurko is seeing what I'm seeing and so sounds like --path-to-ignore
is what I needed (thank you! I didn't know that flag existed)
Following @Trevoke , I'm on 2.2.0
on OSX with ag
installed via brew
. .agignore
works .ignore
does not
ag is said to prefer
.ignore
files (#974), while in reality~/.ignore
is, well, ignored: