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 18, 2015, 18:08 UTC
Message-ID
<xmqq1th8ga9b.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CA+C-WL-CC9o13Rxrr+mKw+vbx=aEJmguLnwMwO=fE-JPJ2DqEg@mail.gmail.com>
Patrick Palka <patrick@parcs.ath.cx> writes:
Show 9 quoted lines
>> I have this nagging feeling that it is just as likely that two
>> uneven hunks align at the top as they align at the bottom, so while
>> this might not hurt it may not be the right approach for a better
>> solution, in the sense that when somebody really wants to do a
>> better solution, this change and the original code may need to be
>> ripped out and redone from scratch.
>
> Hmm, maybe. I stuck with assuming hunks are top-aligned because it
> required less code to implement :)
Yeah, I understand that.

If we will need to rip out only this change but keep the original in order to implement a future better solution, then we might be better off not having this change (if we anticipate such a better solution to come reasonably soon), because it would make it more work for the final improved solution. But if we need to rip out the original as well as this change while we do so, then having this patch would not make it more work, either.

So as I said, I do not think it would hurt to have this as an incremental improvement (albeit going in a possibly wrong direction).

Of course, it is a separate question if this change makes the output worse, by comparing unmatched early parts of two hunks and making nonsense highlight by calling highlight_pair() more often. As long as that is not an issue, I am not opposed to this change, which was what I meant to say by "this might not hurt".

Previous: Patrick PalkaNext: Jeff King
Message 4 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.