-
Notifications
You must be signed in to change notification settings - Fork 335
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
Mercurial support #193
Mercurial support #193
Conversation
Related to #38. Maybe I should add a new test for the Mercurial usecase? |
libexec/diff-so-fancy.pl
Outdated
@@ -55,13 +55,15 @@ | |||
# Look for git index and replace it horizontal line (header later) # | |||
#################################################################### | |||
if ($line =~ /^${ansi_color_regex}index /) { | |||
# Print the line color and then the actual line | |||
$horizontal_color = $1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty crucial part of the git diff logic. It captures the color of the header that we use later. Simply skipping this WILL cause output coloring issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But all the automated tests pass, and when trying it out locally with git the coloring was fine. I guess what we could do is we could capture the color here but print the horizontal line when getting to diff --git
part. This will require additional checks because mercurial does not print index
at all.
Are you still willing to work on this? I'd like to discuss options moving forward. |
@scottchiefbaker – I've been using this locally for a while now and I'm pretty happy with it. Would be awesome to get this upstreamed. Are you willing to merge this in? If so I'll spend some time rebasing it |
Ya I'd be willing to merge this pending some tweaks and testing on my side. I don't use mercurial, so I'll have to rely on your for that. As long as these changes don't break the git pieces I'm ok with that. |
@frantic where are we at on this? Just going through old issues trying to clean up. |
Hey @scottchiefbaker! I've been using this without modifications for 1.5 years now. You mentioned in your last comment that you'll do some testing on your side? If you are still onboard I'll try rebasing |
Yeah go ahead and do that and I'll do some testing on my side! |
A quick update. Basically git uses this:
Mercurial uses this:
I guess I could refactor the code a little to not duplicate the logic, but don't have time at the moment. |
I can look at tweaking the code... can you get me a simple diff out from Mercurial? Something like If it's like you list above it should be super minor changes. I'm pretty confident we can make it work. |
I found a sample |
@scottchiefbaker your version works great with my
i.e. no "index" and no "-r" either |
That looks like pretty standard |
Because the index line and "-r" are missing, there's no initial line (first output is in raw format:
|
Try a git pull I think I just fixed this. |
Even with 0e73558a35a8d45e7014925242ea398426694128? That's weird... can you post your full output
I need the ANSI codes to be included. |
Try pulling again... I just landed 4fcb82013f988798454395bbf9ff1ea6a4650606 |
Ok great! Play around with it for a couple of days and make sure it works for you. I'll land it on |
Awesome, thank you! |
@frantic have you had a chance to test things on your side? I know it's been a long holiday weekend, so you may not have had time yet. I'd like to merge this if you think it's good enough. I don't use mercurial, so I don't have an easy way to verify this. |
@scottchiefbaker sorry for the delay! I tested a few commands and the results look amazing! I'll give it another try next week when I resume heavy work in Mercurial repo, this should help me test edge cases more. |
I've merged all my changes in to |
This will help with Mercurial compatibility – it doesn't output
index
line, anddiff-so-fancy
depends on it to draw the first horizontal line.All
bats test
s pass.Fixes #186