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

Unexpected interaction with symlinks #137

Closed
boblehest opened this issue Sep 29, 2016 · 1 comment
Closed

Unexpected interaction with symlinks #137

boblehest opened this issue Sep 29, 2016 · 1 comment
Labels
bug A bug.

Comments

@boblehest
Copy link

I noticed that rg ignores symlinks by default, even when I invoke it solely to search a single symlinked file. For me, that's very surprising behavior. The -debug flag also said nothing about why it was skipping my file.

So I'm suggestion to either change that behavior (unless maybe it's made this way for a good reason?), or inform the user that his symlinks are being ignored.

@BurntSushi
Copy link
Owner

Agreed, rg should search a symlinked file if it's explicitly specified. This is good enough reason for me:

[andrew@Cheetah tmp] echo test > foo
[andrew@Cheetah tmp] rg test foo
1:test
[andrew@Cheetah tmp] ln -s foo bar
[andrew@Cheetah tmp] rg test bar
No files were searched, which means ripgrep probably applied a filter you didn't expect. Try running again with --debug.
[andrew@Cheetah tmp] grep test bar
test

Otherwise, you can use the -L flag with rg to follow symlinks.

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

No branches or pull requests

2 participants