Use diff-highlight for a better diff output. #587

vonavi opened this Issue Mar 11, 2013 · 7 comments


None yet
3 participants

vonavi commented Mar 11, 2013

Hi guys!

Git supports a nice diff-highlight feature from My workaround is to put the diff-highlight script in $PATH. Then I use Elisp snippet magit-diff-highlight.el and get a better diff output. For the details, see the description of diff-highlight. But my code is a hack, and I'm very interested in to incorporate such an opportunity into Magit immediately. What do you think about this?

Best regards,


mgalgs commented May 14, 2013

I would like to see this feature as well but would rather see it implemented in elisp. It's better not to depend on an external script (even if that script is bundled with the git source (not everyone has the git source around, for example)). It's only 173 lines of perl, should be a fairly straightforward port :).


tarsius commented May 26, 2013

A before/after screenshot could help motivating me to look into this.

@ghost ghost assigned tarsius May 26, 2013

vonavi commented May 26, 2013

I updated magit-diff-highlight.el, and now a Magit diff looks like this screenshot.

Best regards,


tarsius commented Jul 6, 2013

That looks interesting I will try to have a closer look soon.


tarsius commented Jul 8, 2013

Actually magit already supports something like this. Try customizing magit-diff-refine-hunk.


mgalgs commented Jul 9, 2013

magit-diff-refine-hunk (or magit-toggle-diff-refine-hunk, bound to h) works for me! That's so awesome...

vonavi commented Jul 12, 2013

Thanks a lot @tarsius! magit-toggle-diff-refine-hunk looks excellent! Unfortunately, there is no documentation about this feature.

@vonavi vonavi closed this Jul 12, 2013

@tarsius tarsius added this to the 2.1.0 milestone Feb 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment