-
-
Notifications
You must be signed in to change notification settings - Fork 2k
-
-
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
Allow following symlinks to files #2811
Comments
What does GNU grep do here? |
(But I'd prefer not to have to.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just got caught in the situation described in #460: ripgrep didn't find a file I knew existed, and it turned out that the file was actually a symlink to another file in the same directory.
In general, it seems to me that skipping symlinks to directories is a sensible default, but I'm not quite convinced that skipping symlinks to files is sensible. At least I'd like to be able to ask ripgrep to follow symlinks to files and search their contents without ripgrep also following symlinks to directories and recursing into them.
While following a symlink to a huge directory, or a directory on a network share, or to, say,
/proc
or/sys
could cause all sorts of pathological behavior, following a symlink to a file only doubles the matches output for that file.I propose an extension to the
--follow
switch to specify which target types should be processed via symlinks. It could be documented as follows:Thanks for considering this!
The text was updated successfully, but these errors were encountered: