From: Michael J Gruber <git@drmicha.warpmail.net>
To: Stefan Haller <lists@haller-berlin.de>
Cc: git@vger.kernel.org
Subject: Re: Interdiff between amended commits
Date: Thu, 14 Apr 2011 10:47:42 +0200 [thread overview]
Message-ID: <4DA6B4AE.1090701@drmicha.warpmail.net> (raw)
In-Reply-To: <1jzpkig.1g2zjmtgv7a68M%lists@haller-berlin.de>
Stefan Haller venit, vidit, dixit 14.04.2011 10:09:
> Michael J Gruber <git@drmicha.warpmail.net> 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
prev parent reply other threads:[~2011-04-14 8:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 11:54 Interdiff between amended commits Stefan Haller
2011-04-14 7:08 ` Michael J Gruber
2011-04-14 8:09 ` Stefan Haller
2011-04-14 8:47 ` Michael J Gruber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DA6B4AE.1090701@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=lists@haller-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.