ignore patterns should not directory below their source file
arenevier opened this issue · comments
arno renevier commented
If I folder contains a .gitignore file with a pattern of the same name as the folder, ag will not find anything when searching that directory from the parent.
Here are instructions to reproduce the issue:
mkdir -p myprogram
cd myprogram
# Lets assume this project will later build a binary called by program. Put it in .gitignore
echo myprogram > .gitignore
# now, start writing the source
echo "print 'hello world'" > main.py
cd ../
# now, search for a string in that directory
ag hello myprogram
Nothing is found
ag -D hello myprogram
will show
DEBUG: file myprogram/main.py ignored because path somewhere matches name myprogram
This seems wrong since the ignore directive is defined in myprogram/.gitignore. So it should not apply to directory names below that definition.