fd icon indicating copy to clipboard operation
fd copied to clipboard

Custom --ignore-file-name

Open baryluk opened this issue 8 months ago • 3 comments

--ignore-file-name=FOO

When set, instead of inspecting .ignore and ~/.fdignore, only look for file FOO in each directory, and use that in the logic.

This is useful when having multiple traversal policies, or adapting existing ignore files from other project (i.e. backup softwares, borg - .EXCLUDE.BACKUP, kopia - .kopiaignore).

If file is present, but empty (modulo empty lines), ignore all, including subdirs. If present, but non-empty, interpret similar to ignore/gitignore/kopiaignore in general.

baryluk avatar Apr 25 '25 19:04 baryluk

I’d like to work on this issue. From the description, I understand the goal is to support a --ignore-file-name=FOO option that overrides the default .ignore / ~/.fdignore lookup and instead only uses the specified file per directory.

I plan to implement:

Detection of the custom ignore file in each directory. Handling the empty file case (ignore all, including subdirs). Parsing non-empty files in the same way as existing ignore files. Could you confirm if this approach aligns with the intended design?

AshhKetchup avatar Aug 30 '25 19:08 AshhKetchup

@AshhKetchup there is already a pull request (#1726) but I don't think anyone has had a chance to review it

tmccombs avatar Aug 31 '25 02:08 tmccombs

Thank you both @Witheringstorm and @AshhKetchup for looking into this.

I do not personally need this feature anymore too much (I managed to do some work with custom code and rsync mostly), but it might still be useful for more generic use cases.

baryluk avatar Sep 01 '25 14:09 baryluk