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

Re: Patchdiff

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 27, 2010, 01:30 UTC
Message-ID
<7vzl40wcz2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.00.1001262014250.1681@xanadu.home>
Nicolas Pitre <nico@fluxnic.net> writes:
Show 11 quoted lines
>> Do we have anything that allows me to compare two versions of a patch?
>> In theory it'd do something like "apply both patches to the their
>> merge base, then show the diff between the results". I don't think we
>> have something like that, since there's probably some major caveats
>> about conflicts when applying the patches to their merge-base. Or
>> perhaps my theory is silly, and there's an easier way to compare two
>> patches (other than looking at a diff's diff, which I've never been
>> good at).
>
> What about Git's diff -c/--cc ?  You'd have to reverse the parenthood 
> logic though.

When I did "diff --cc" originally, I thought about its interaction with reverse (-R), and gave up.

The thing is, "--cc" output needs to show "here is _the_ end result", together with "and each sides did things in these different ways (shown with +/- annotations)".

When showing a merge, there is one end result (the merged version), so it fits the model that is a natural extension of two-way diff. In the "two patches walked in a bar, modified the same version and produced two different results" case, the common thing is the preimage, not postimage. I couldn't come up with a combined output format that visually makes sense for that mode of operation.

Previous: Nicolas PitreNext: Nicolas Pitre
Message 4 of 6 in “Patchdiff”
  1. Sverre RabbelierJan 27, 2010
  2. Jonathan NiederJan 27, 2010
  3. Nicolas PitreJan 27, 2010
  4. Junio C HamanoJan 27, 2010
  5. Nicolas PitreJan 27, 2010
  6. Bert WesargJan 27, 2010

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.