Skip to content
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

respect hidden file attribute #379

Closed
ghost opened this issue Jan 1, 2019 · 6 comments · Fixed by #478
Closed

respect hidden file attribute #379

ghost opened this issue Jan 1, 2019 · 6 comments · Fixed by #478

Comments

@ghost
Copy link

ghost commented Jan 1, 2019

currently FD considers a hidden file something starting with ., which is a
long time Linux convention

However the Windows convention of the hidden file attribute is not recognized by
FD. So if you have some files on Windows with the hidden file attribute, FD will
always show them regardless of -H option, unless they also happen to start
with .

@colinwahl
Copy link

After briefly looking into this, it appears that fd uses ignore to walk the directory tree. It looks like the behavior you are describing stems from https://github.com/BurntSushi/ripgrep/blob/master/ignore/src/pathutil.rs#L20. Perhaps this issue should be raised there?

@sharkdp
Copy link
Owner

sharkdp commented Feb 13, 2019

Thank you for the notice. We are going to include this as soon as the next ignore release is published.

@ghost
Copy link
Author

ghost commented Jul 28, 2019

@sharkdp
Copy link
Owner

sharkdp commented Jul 29, 2019

Thank you for the reminder. Happy to include this into fd. We should probably also add a (Windows-only) test. I didn't look into how ignore implements this, but I think it would be reasonable to say that files starting with a dot would also be counted as "hidden" on Windows.

@ghost
Copy link
Author

ghost commented Jul 29, 2019

@sharkdp thats an interesting comment

i think its a difference between "hidden" and "dont show by default"

strictly speaking, dotfiles are not hidden by default on Windows. However most users probably dont care whats in them, and dont want them showing up in search results, in the general case. so if that means lumping dotfiles with true hidden files on windows, i am cool with that. but i think its an important distinction to make.

@sharkdp
Copy link
Owner

sharkdp commented Sep 15, 2019

Handling of hidden files is now supported in v7.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants