git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 diff
will 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%.
Previous: Jeff KingNext: Patrick Palka
Message 16 of 20 in “Improve contrib/diff-highlight to highlight unevenly-sized hunks”
  1. Improve contrib/diff-highlight to highlight unevenly-sized hunksPatrick Palka, Jun 15, 2015
  2. Junio C HamanoJun 18, 2015
  3. Patrick PalkaJun 18, 2015
  4. Junio C HamanoJun 18, 2015
  5. Jeff KingJun 18, 2015
  6. Patrick PalkaJun 18, 2015
  7. Jeff KingJun 18, 2015
  8. Jeff KingJun 18, 2015
  9. Junio C HamanoJun 18, 2015
  10. Patrick PalkaJun 18, 2015
  11. Jeff KingJun 19, 2015
  12. Junio C HamanoJun 19, 2015
  13. Jeff KingJun 19, 2015
  14. Jeff KingJun 19, 2015
  15. Jeff KingJun 19, 2015
  16. Junio C HamanoJun 19, 2015
  17. Patrick PalkaJun 18, 2015
  18. Patrick PalkaJun 18, 2015
  19. Jeff KingJun 18, 2015
  20. Patrick PalkaJun 18, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.