-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Help text for --hidden should clarify what "hidden" means #1847
Help text for --hidden should clarify what "hidden" means #1847
Comments
I agree it should be better documented. The reason why ripgrep does this wasn't an accident though. The prefix-dot convention is also used on Windows. It just isn't recognized (AFAIK) by Windows itself. Your doc update LGTM. |
Thanks! I can definitely imagine going either way on an initial decision about how to treat dotfiles on Windows; now that it's a backcompat concern to change it, I think it would be hard to argue for changing the behavior and agree that sticking to just a doc update makes the most sense. I'll send a PR with the doc update. Do you have a preference on whether to include the pointer in the |
Ah yup, that SGTM too! We can hash out the wording if necessary in the PR. |
On Windows, we didn't previously document that ripgrep respected both the prefix-dot convention _and_ the "hidden" attribute on files. Fixes #1847
What version of ripgrep are you using?
How did you install ripgrep?
Issue repros with both
scoop install ripgrep
andcargo install ripgrep
versionsWhat operating system are you using ripgrep on?
Windows 10 Version 20H2 (OS Build 19042.867)
Describe your bug.
On Windows, ripgrep (via
ignore
) considers files which have the "hidden" attribute OR whose basename starts with a.
to be "hidden" for the purposes of the--hidden
flagripgrep/crates/ignore/src/pathutil.rs
Lines 22 to 46 in 64ac2eb
I can understand why ripgrep might want to ignore
.dotfiles
on Windows for consistency (and that changing it now would be breaking), but as a Windows user, I was surprised by this behavior because it uses a meaning of the term "hidden" which is different from the OS's without documenting that it's going to do so. It would be nice ifrg --help
's--hidden
section could clarify what ripgrep considers to be a "hidden" file, similar to the comment inpathutil.rs
.What are the steps to reproduce the behavior?
What is the actual behavior?
What is the expected behavior?
Something along the lines of
My initial attempts at searching through the ripgrep documentation to understand why it was skipping
.directories
by default involvedrg --help | rg -e dot
, which pointed me to the--no-ignore-dot
flag (which sounds promising but isn't actually relevant to ignoring dotfiles generally). If that feels like a mistake that other users might reasonably be expected to make, it might be worth additionally updating the--no-ignore-dot
help section with a pointer along the lines ofThis does **not** affect whether ripgrep will ignore files and directories whose name begins with a dot. For that, see --hidden and --no-hidden.
I also noticed that the
--no-hidden
flag the--hidden
section mentions doesn't have a top-level help entry; not sure if that's intentional.The text was updated successfully, but these errors were encountered: