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.