Re: [PATCH] Improve contrib/diff-highlight to highlight unevenly-sized hunks
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 19, 2015, 17:20 UTC
- Message-ID
- <xmqqlhffaa4f.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150619053223.GA27241@peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> I do strip it off, so it is OK for it to be different in both the > pre-image and post-image. But what I can't tolerate is the > intermingling with actual data: > > +\t\t\x1b[32m;foo > +\t\x1b[32m;bar
I think that depends on the definition of "strip it off" ;-) What I meant was that whitespace coloring can appear anywhere on the line, e.g.
echo COPYING whitespace=tab-in-indent,-space-before-tab >.gitattributes
printf " \tHeh\n" >>COPYING
git diffwill give you
<new> + <reset> SP <wserror> HT <reset> <new> Heh <reset> LF
Obviously, stripping "+" painted in "new" is not sufficient.
Side note: hmm, shouldn't that SP painted in <new>, though?
> I think this "array of spans" is the only way to go. Otherwise whichever > markup scheme processes the hunk first ruins the data for the next > processor.
Yes, I agree with that 100%.