`ag -u` won't search a submodule if its directory is in .gitignore
pacenathan opened this issue · comments
Nathan Arthur commented
I work with a git repo that has multiple submodules. For various reasons (important to us, so we can't just change it), some of those subomdule directories are listed in the repo's .gitignore
file, on some branches. This somehow causes ag
to fail to search into those submodule directories, even with -u
.
Running this sequence of commands will demonstrate the issue, if your git install is configured to observe .gitignore
inside the repo:
mkdir outer && cd outer && git init
git submodule add git@github.com:ggreer/the_silver_searcher.git
ag -ul valgrind
echo '/the_silver_searcher/' > .gitignore
ag -ul valgrind
The first ag -ul valgrind
will find results; the second one will not.