Re: Interdiff between amended commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Haller venit, vidit, dixit 14.04.2011 10:09:
> Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> wrote:
> 
>>> So one thing I came up with is this:
>>>
>>>   git checkout commit1^
>>>   git cherry-pick --no-commit commit2
>>>   git diff --cached
>>
>> That does something completely different. It compares the tree of
>> commit1^ with the tree of (commit1^ with commit2's patch applied). I
>> don't see how commit1's patch plays any role here.
> 
> Sorry, that was just a typo.  I meant
> 
>   git diff --cached commit1
> 
> as the last line, of course.
> 
> Alternatively, I could do it the other way round, by saying
> 
>   git checkout commit2^
>   git cherry-pick --no-commit commit1
>   git diff --cached -R commit2
> 
> That should produce the same result (except maybe for the line numbers
> in the hunk headers), as long as the cherry-pick didn't have conflicts.
> 
>> Depending on what your actual use case, you may be happier with "git
>> diff commit1 commit2"
> 
> No, that's not what I want (except when commit1 and commit2 have the
> same parent).  This would also show the differences between the parents
> of commit1 and commit2; I don't want to include those.
> 
> My actual use case is that I have a central repository that sends out
> commit emails; when someone does an interactive rebase and amends a
> commit in the middle of a branch, I want to match up corresponding
> commits based on their subject line, and then send an email showing how
> the diff for that commit changed.

In that case, "git diff --no-index" on the two patches (i.e. the alias
you found with "interdiff" replaced) may be worth a try. We should be
able to teach our diff machinery about our diffs :) I mean, see userdiff
and funcname.

Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]