fd seems to no longer honor gitignore files by default? To test this, I setup a basic file structure for testing:
$ tree -a .
.
|-- .gitignore
|-- a/
| `-- file1.txt
|-- b/
| `-- file2.txt
`-- c/
`-- file3.txt
3 directories, 4 files
The .gitignore just contains:
a/
Then when I run fd I get this:
$ fd
a
a/file1.txt
b
b/file2.txt
c
c/file3.txt
But if I explicitly add the .gitignore as an ignore-file it works:
$ fd --ignore-file .gitignore
b
b/file2.txt
c
c/file3.txt
Also, renaming it to .ignore works:
$ mv .gitignore .ignore
$ fd
b
b/file2.txt
c
c/file3.txt
The README still talks about .gitignore being honored by default and the options on the app seem to indicate that it will be used unless disabled. However, that doesn't seem to be the case.
$ fd --version
fd 7.3.0
Thank you for the feedback!
As of recently, .gitignore files are only honored if the folder is actually a Git repository. Hope that resolves your question.
Thank you for clarifying. I was going to complain that this isn't clarified in the docs, but I just looked again and saw this:
If we work in a directory that is a Git repository (or includes Git repositories), fd does not search folders (and does not show files) that match one of the .gitignore patterns.
So apparently I just can't read. Appreciate you pointing me in the right direction. Will close now.
Most helpful comment
Thank you for the feedback!
As of recently,
.gitignorefiles are only honored if the folder is actually a Git repository. Hope that resolves your question.