-
Notifications
You must be signed in to change notification settings - Fork 48
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
When ripgrep is installed, vgrep exits when a file with no read access is in the directory #216
Comments
Thanks for reaching out, @inknos ! Always happy to see vgrep being used in the wild :) Without ripgrep vgrep will try to use git-grep which does not fail when the sudofile hasn't been committed yet. I tried it with --no-ripgrep which also works because vgrep uses git-grep. Adding the --no-git flag will then fail again, because vgrep will then use grep. What vgrep could do is to parse stdout even in case of an error, and report the error with the same exit code as the underlying grep implementation. |
Try parsing the stdout of *grep even in case of an error. This allows to return output when hitting, for instance, eperms on certain files. The stderr of *grep is now logged directly while the exit code is being recorded and used by vgrep on exit. Fixes: #216 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Try parsing the stdout of *grep even in case of an error. This allows to return output when hitting, for instance, eperms on certain files. The stderr of *grep is now logged directly while the exit code is being recorded and used by vgrep on exit. Fixes: #216 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Try parsing the stdout of *grep even in case of an error. This allows to return output when hitting, for instance, eperms on certain files. The stderr of *grep is now logged directly while the exit code is being recorded and used by vgrep on exit. Fixes: #216 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Try parsing the stdout of *grep even in case of an error. This allows to return output when hitting, for instance, eperms on certain files. The stderr of *grep is now logged directly while the exit code is being recorded and used by vgrep on exit. Fixes: #216 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Try parsing the stdout of *grep even in case of an error. This allows to return output when hitting, for instance, eperms on certain files. The stderr of *grep is now logged directly while the exit code is being recorded and used by vgrep on exit. Fixes: #216 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Reproducer:
vgrep
andripgrep
vgrep
andcd
into itsudo touch sudofile
3.1.
sudo chmod o-r sudofile
4.1.
vgrep something
Results:
searching symbols failed: rg: sudofile: Permission denied (os error 13) [rg]
Expected results:
Versions:
$ rpm -q vgrep
vgrep-2.6.1-3.fc39.aarch64
$ rpm -q ripgrep
ripgrep-14.1.0-2.fc39.aarch64
Additional information:
Uninstalling
ripgrep
fixes it. I did some digging and these look like the offending lines. I don't know go much though, so I don't know how to fix it from the top of my head :)It would be nice to see this fixed, especially because running it like in the README leads to
[Command failed: vgrep --no-header 'something']
and it does not really say what's wrong.The text was updated successfully, but these errors were encountered: