-
-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --prune flag #658
Add --prune flag #658
Conversation
Thank you very much for your contribution! That is a very simple implementation indeed! 👍 😄
It would be great if you could run them just to be sure - but I agree that it does not look like it could have a significant impact in non-pruned searches.
That sounds reasonable, but I would appreciate if we could think about this in detail (and add tests if necessary). Are there any options that could interfere with I have listed a few options here: #546 (review) |
I would also ask you to please update the man page and ideally (if you feel comfortable with that) the newly added Also, could you please add an entry to the "unreleased" section in
where Thank you! |
# Conflicts: # CHANGELOG.md
I ran release builds of fd from the master branch (fd-master.exe) and this PR branch (fd-prune.exe) on a directory with 127,635 files and 14,127 directories, and saw no significant performance difference without pruning:
The behavior of However, there are some options that will definitely make
Should we detect these combinations? If so, should
I've updated the man page and
Done! |
I think we could safely just ignore all of these interactions.
That seems like a minor problem. A user could theoretically run a
can be safely ignored, I guess.
Thank you! |
I agree. I've updated the PR accordingly.
The time based filters can also match directories, so I don't think there's any interaction with pruning here. You didn't mention |
Yes, let's also mark it as conflicting. Would the same be true for |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates and the explanation!
Any chance to cut a release from master? I could use the flag |
relates to sharkdp/fd#658
released in v8.2.0. |
* fd 8.2.0 * fd: fix zsh_completion location relates to sharkdp/fd#658 Closes #66345. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This PR introduces the --prune flag and fixes #535.
The previous PR #546 for this issue has been closed. I'd like to continue the work and discussion on this issue in this PR.
The implementation proposed in this PR is the simplest one I could come up with (which is roughly the initial implementation from PR #546): If a directory matches (regardless of which options caused the match), and the
--prune
flag is set, do not traverse further into the directory.To start off the discussion, I'd like to address the concerns raised by @sharkdp in the previous PR:
--prune
flag should be negligible, as it's just one additional flag to check for each matching entry. I can still perform benchmarks if needed.