Subject: Re: [PATCH v2 7/7] color: support strike-through attribute

From: Junio C Hamano <[email-masked]>
Date: Thu, 23 Jun 2016 12:56:08 -0700

Jeff King <[email-masked]> writes:

> ... but with --color-words, it actually helps quite a
> bit (try it on the documentation patch from this series, for example).

This gets me back to another tangent, but this time a one that is
quite a lot more relevant to Git.

There is this change in "git show --word-diff" for the "italic"
patch:

    The accepted attributes are `bold`, `dim`, `ul`, `blink`,
    {+`reverse`,+} and [-`reverse`.-]{+`italic`.+}

If we imagine that the pre- and post- image expressed in "one token
per line" format, the text before and after the patch would have
read like this:

    preimage		postimage
    -----------         ------------
    ...			...
    blink		blink
    ,			,
    and			reverse
    reverse		,
    .			and
    			reverse
                        .

And the current output is showing an equivalent of this diff:

	...
        blink
        ,
       +reverse
       +,
        and
       -reverse
       -.
       +italic
       +.

But if we were doing line-level diff for the above two, I would
think this is much easier to read:

	...
        blink
        ,
       -and
        reverse
       +,
       +and
       +italic
       +.

That would give us a word-diff more like this, I would imagine,

    The accepted attributes are `bold`, `dim`, `ul`, `blink`,
    [-and-] reverse[-,-] {+and `italic`}.

and that would be much easier to read than the current --word-diff
output.