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

Re: Lines missing from git diff-tree -p -c output?

From
Matthijs Kooijman <matthijs@stdin.nl>
Date
May 15, 2013, 17:33 UTC
Message-ID
<20130515173312.GR25742@login.drsnuggles.stderr.nl>
In-Reply-To
<7vhai4cgco.fsf@alter.siamese.dyndns.org>
Hi Junio,
> I think the coalescing of two adjacent hunks into one is painting
> leading lines "interesting to show context but not worth showing
> deletion before it" incorrectly.
Yup, that seems to be the case.
> Does this patch fix the issue?

Yes, it fixes the issue. However, I think that this patch actually hides the real problem (in a way that will always work with the current code, though).

I had come up with a different fix myself (similar to the one I sent to the list as a followup, but that one still had a bug), which I think might be better. In any case, it includes a testcase for this bug which seems good to include.

I'll send my patch as a followup in a minute, feel free to use it entirely or only partially.

Gr.
Matthijs
Previous: Junio C HamanoNext: Matthijs Kooijman
Message 4 of 8 in “Lines missing from git diff-tree -p -c output?”
  1. Matthijs KooijmanMay 15, 2013
  2. Matthijs KooijmanMay 15, 2013
  3. Junio C HamanoMay 15, 2013
  4. Matthijs KooijmanMay 15, 2013
  5. combine-diff.c: Fix output when changes are exactly 3 lines apartMatthijs Kooijman, May 15, 2013
  6. Junio C HamanoMay 15, 2013
  7. Matthijs KooijmanMay 15, 2013
  8. Junio C HamanoMay 15, 2013

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.