Re: Howto get the merge-base ?

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

 



"Bertrand Jacquin" <beber.mailing@xxxxxxxxx> writes:

> On 5/14/06, Junio C Hamano <junkio@xxxxxxx> wrote:
>> "Bertrand Jacquin" <beber.mailing@xxxxxxxxx> writes:
>>
>> > I'm trying to know which commit it the parent of a merge.
>> > For exemple if I do that :
>> >
>> >   o Merge
>> >  / \
>> > /   \
>> > |   |
>> > |   o Commit D
>> > |   |
>> > |   o Commit C
>> > |   |
>> > o   | Commit B
>> > \  /
>> >  \/
>> >  o Commit A
>> >  |
>> >  o Init
>> >
> No, that's just on the following of git-send-mail-commit.sh thread (or
> something near). To make a readable merge mail with diffstat and
> summury.

For that you do not want merge-base.  If your mainline was A-B
and you merged a side branch B-C-D with the merge, then to
people who tracked your head (that's the audience of "merge
mail", I presume) they just need to see:

	git diff --stat M^1..M
	git rev-list --no-merges --pretty M^1..M | git shortlog

The diffstat is "what damage was inflicted on the branch you
have been following with this merge", so the diff between the
trees before and after the merge is what you want.  And the
rev-list piped to shortlog is to show "what commits were _not_
present on this branch before the merge, but are present after
the merge" (it could be spelled M^1..M^2 but the above would
handle octopus as well).


-
: 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]