threads / discuss / 22403

Patchdiff

Subject: Patchdiff

## tl;dr

6 messages between Jan 27, 2010 and Jan 27, 2010.

replies: 5people: 5as markdown or json

Sverre Rabbelier· Jan 27, 2010, 00:06 UTC · lore
Heya,

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).

-- 
Cheers,

Sverre Rabbelier
Jonathan Nieder· Jan 27, 2010, 01:09 UTC · re: Sverre Rabbelier · lore

Re: Patchdiff

Hi,
Sverre Rabbelier wrote:
> 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".
It’s not git specific, but maybe interdiff [1] could help.

Ciao, Jonathan

[1] http://cyberelk.net/tim/data/patchutils/stable/
Nicolas Pitre· Jan 27, 2010, 01:19 UTC · re: Sverre Rabbelier · lore

Re: Patchdiff

On Wed, 27 Jan 2010, Sverre Rabbelier wrote:
Show 10 quoted lines
> Heya,
> 
> 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.

Nicolas
Junio C Hamano· Jan 27, 2010, 01:30 UTC · re: Nicolas Pitre · lore

Re: Patchdiff

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.

Nicolas Pitre· Jan 27, 2010, 01:40 UTC · re: Junio C Hamano · lore

Re: Patchdiff

On Tue, 26 Jan 2010, Junio C Hamano wrote:
Show 6 quoted lines
> 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.
Hmmmmmm yeah.  I didn't think it through all the way.  Too bad.
Nicolas
Bert Wesarg· Jan 27, 2010, 07:06 UTC · re: Junio C Hamano · lore

Re: Patchdiff

On Wed, Jan 27, 2010 at 02:30, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> Nicolas Pitre <nico@fluxnic.net> writes:
>
>>> 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.

Actually, I have done this. My intention is to use this as a new merge conflict style.

I will send the patch, but not today.

Regards, Bert

← back to recent threads