-
Notifications
You must be signed in to change notification settings - Fork 356
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 git-delta munges filenames with hyphens #1259
Comments
Hello, It looks like the hyphens are also replaced in the branch names, not just the filenames, e.g.: $ git grep --no-pager mptcp_ t/upstream-net
t/upstream-net:<file>:<match> ## without Delta
(...)
$ git grep mptcp_ t/upstream-net
t/upstream:net:<file>:<match> ## with Delta
(...) (with Delta, we have |
Hi @nickurak @matttbe ultimately the problem here is that traditional grep output is not unambiguously parseable, due to the use of characters as delimiters which might also occur in file names. That said, it definitely might be possible to fix the bugs you're highlighting. Check out the (not nice) code which explains the problem and the attempts to solve it by trying various regexes: Lines 320 to 325 in ce41a39
If you can see how to improve that code and make it work for a larger set of inputs I'd be happy to accept changes: the code does at least have decent unit tests so you can experiment with different approaches fairly easily. Personally, I would say the best solution is to use |
I just hit this and got incredibly confused when |
@rossburton is it possible for you to use
Copying from #1631 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 |
Reproduction steps:
Setup:
Symptoms:
-
in file name is replaced with:
:returns:
instead of the expected no-pager output of:
which yields:
Version:
The text was updated successfully, but these errors were encountered: