-
Notifications
You must be signed in to change notification settings - Fork 382
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
🐛 Incorrect output when grepping in a branch with "/" and "-" in the name #1083
Comments
Thanks @cffswb, will look into this. By the way, until this is fixed, I just want to mention that piping |
This seems to also affect paths whose element just above the file has a The same command from the This seems to happen when the path element with the |
@mvf Confirmed. Here's a reproducible example of that:
There are hits in |
Hi all, currently the best answer here is to use The delta manual contains an entry addressing this:
See the ~500 lines of unit tests here: https://github.com/dandavison/delta/blob/main/src/handlers/grep.rs#L653-L1177. If someone can improve the parsing while keeping all those tests passing (and hopefully adding a test for what you're fixing) that would be fantastic. I'm going to close this since I have personally taken a fairly large stab at it and also implemented |
@dandavison One idea for handling this unambiguously (asking first to find out if this would be an acceptable solution):
|
@joshtriplett I think that's a good idea! I had thought that git would refuse to deliver the color escape codes when sending output to its pager, but it looks like it does, as can be verified with
It seems that |
@dandavison Yes, grep and other commands use color by default unless disabled. However, people can customize the colors/styles. So, delta might want to document what does and doesn't work. |
@dandavison Fixed: #1634 |
Context
OS: Linux
Delta revision: 427c9aa
Description
Tested in
delta
repository.Run
git grep
alone:$ GIT_CONFIG_GLOBAL=/dev/null git grep theme origin/gh-pages
Run
git grep
+delta
:$ GIT_CONFIG_GLOBAL=/dev/null git -c pager.grep='delta --no-gitconfig' grep theme origin/gh-pages
The
gh-pages
es becomegh:pages
es, and thetheme
s aren't highlighted.The text was updated successfully, but these errors were encountered: