sharkdp/fd

Discussion: show Git-ignored files by default?

Open

#612 建立於 2020年6月7日

在 GitHub 查看
 (68 留言) (37 反應) (0 負責人)Rust (42,984 star) (1,059 fork)batch import
help wantedquestion

描述

Since fd was first published, the feature to hide Git-ignored files by default has always been controversial. It's the number one pitfall for new users, as witnessed by the numerous issues that have been opened over time (even though this is the first point in the Troubleshooting section). Even experienced users will likely run into this from time to time.

We have had past discussions about this (see #179, #220, #18), but I'm not so sure anymore if this default is the best possible option for the "average user".

I thought it might make sense to discuss this again and see what others think. Whatever we choose as the default, it will always be easy for users to select a different default via an alias.

Pro current behavior (do not show .gitignored entries by default):

  • Most searches are faster if we take .gitignore files into account. .gitignored directories tend to contain huge amounts of automatically generated build artifacts or downloaded dependency files. Pruning these directories from the search tree typically results in a faster search overall. There are counterexamples to this where the parsing of long .gitignore files takes longer than actually traversing these directories.
  • Most of the time, .gitignored results are not "interesting" to the user (however, see counterpart below).
  • When running fd without any arguments, I typically don't want to see .gitignored files.

Cons:

  • It can be very confusing to (new) users. If 10% of users go so far as to create a ticket on GitHub to ask about their problem, there must be hundreds of users that ran into this problem at some point.
  • Even if you know about the default, it can be annoying to repeat the search because you forgot to add -I or -u. There are a lot of valid use cases where users are - in fact - interested in results from ignored directories or files. Personally, I would estimate that I use -uu or -HI in roughly 20% of my searches, which is quite high.

貢獻者指南

Discussion: show Git-ignored files by default? · sharkdp/fd#612 | Good First Issue