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

Follow symlinks by default #180

Closed
ChengCat opened this issue Nov 27, 2017 · 3 comments
Closed

Follow symlinks by default #180

ChengCat opened this issue Nov 27, 2017 · 3 comments
Labels

Comments

@ChengCat
Copy link

ChengCat commented Nov 27, 2017

Not following symlinks by default introduces the pitfall that we may fail to consider about symlinks, which are not often used. I have actually fallen into this pitfall several days earlier. I understand that the traditional alternative find also does not follow symlinks by default, but IMO we should provide a saner default nonetheless.

@ghuls
Copy link

ghuls commented Nov 28, 2017

Following symlinks by default naively might be not a great idea.
If a symlink points to a parent (or ... grand parent) directory, you might end up with endless recursion.
So if symlinks were followed by default, it probably should be restricted to symlinks that point directly to files only.

@sharkdp
Copy link
Owner

sharkdp commented Nov 28, 2017

you might end up with endless recursion

This is actually not possible. The ignore crate detects cycles:

> tree
.
├── a
│   └── link_to_parent -> ..
└── hello.txt

2 directories, 1 file

> fd -L hello a
a/link_to_parent/hello.txt

@sharkdp
Copy link
Owner

sharkdp commented Dec 14, 2017

I think we should stay consistent with not only find but also ripgrep and other tools.

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

No branches or pull requests

3 participants