sharkdp / fd

A simple, fast and user-friendly alternative to 'find'
Apache License 2.0
34.3k stars 816 forks source link

Ability to disable one or more `.gitignore` files without having to use `--no-ignore-vcs` #1558

Closed j-lakeman closed 6 months ago

j-lakeman commented 6 months ago

Would be quite handy to be able to ignore the content of selectable .gitignore files. Maybe by listing them in the .fdignore, for example: path_to/.gitignore I came across this issue after integrating fd deeper into my workflows e.g. in combination with fzf.

Nevertheless great application!

tmccombs commented 6 months ago

Not sure if it helps your use case, but you could do the other way around, and use --no-ignore-vcs, then specify specific .gitignore files to use with --ignore-file

j-lakeman commented 6 months ago

Cheers for the support! Thing is in my case I only want to exclude a single .gitignore, but keep the individual ones in subfolders and the global git as well as fd one while also having hidden files enabled.

So what I'm doing atm as a workaround is calling fd --hidden --no-ignore-vcs. I have also tried fd -u --ignore-file .config/fd/ignore.

But with both approaches, I would need to re-enable dozens of .gitignore files buried somewhere in the file system. Hope this helps to clarify!

tmccombs commented 6 months ago

I see.

That seems like a somewhat unusual use case to me, so I'm not sure it would be worth adding that functionality.

j-lakeman commented 6 months ago

Fair enough. Is it doable to implement a fdrc like ripgrep does (https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file) instead? That way I could work around my issue and a lot of other possible use cases other folks might have could be covered.

tmccombs commented 6 months ago

See #362

As a current workaround you can use an alias, or a wrapper script

j-lakeman commented 6 months ago

Cheers! Closing in favour of #362