[Pdx-pm] diff_painter.pl

Matthew Wickline m_pm_pdx at wickline.org
Wed Apr 13 22:31:28 PDT 2011

> I can’t get it to show me anything like that, even on output on
> which it ostensibly should. All it shows me is the same output as
> the regular diff (except also colourised with background colours):
> if a portion of a line has changed, it just shows the before and
> after lines, rather than a single line with a colourised portion.

I've added some examples. If you diff -u the before and after files
you should get something like the png at


Note that the bottom two block edits didn't render as block edits
because a rows was added or inserted. The script does not try to merge
lines when presented with N minus lines followed by other-than-N plus
lines. It only wants to merge N minus lines with N plus lines.

Another case you might be hitting is that if too many edits are done
in a line, it decides that it would look better to show you "this
whole line changed into this other whole line" rather than trying to
merge the two lines.

As for input, basically anything that looks like diff or diff -u. That
would include svn diff and git diff and git log -p.

More information about the Pdx-pm-list mailing list