Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ignore patterns should not directory below their source file #1528

Open
arenevier opened this issue Aug 6, 2023 · 0 comments
Open

ignore patterns should not directory below their source file #1528

arenevier opened this issue Aug 6, 2023 · 0 comments

Comments

@arenevier
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant