threads / discuss / 24714

specifying one-side of a merge commit?

Subject: specifying one-side of a merge commit?

## tl;dr

3 messages between Aug 12, 2010 and Aug 12, 2010.

replies: 2people: 3as markdown or json

Tay Ray Chuan· Aug 12, 2010, 05:11 UTC · lore
Hi,
I wonder how do you guys do this?
So far, what I've come up with is this:
  $ git rev-list $MERGE ^$MERGE^ | head -2 | tail -1
I'm sure there's a better way.
-- 
Cheers,
Ray Chuan
Elijah Newren· Aug 12, 2010, 06:01 UTC · re: Tay Ray Chuan · lore

Re: specifying one-side of a merge commit?

On Wed, Aug 11, 2010 at 11:11 PM, Tay Ray Chuan <rctay89@gmail.com> wrote:
Show 9 quoted lines
> Hi,
>
> I wonder how do you guys do this?
>
> So far, what I've come up with is this:
>
>  $ git rev-list $MERGE ^$MERGE^ | head -2 | tail -1
>
> I'm sure there's a better way.
$MERGE^2

(^1 means first parent of a commit, ^2 means second parent, etc. Plain '^' as suffix with no numeral implies ^1).

Björn Steinbrink· Aug 12, 2010, 06:11 UTC · re: Tay Ray Chuan · lore

Re: specifying one-side of a merge commit?

On 2010.08.12 13:11:52 +0800, Tay Ray Chuan wrote:
Show 9 quoted lines
> Hi,
> 
> I wonder how do you guys do this?
> 
> So far, what I've come up with is this:
> 
>   $ git rev-list $MERGE ^$MERGE^ | head -2 | tail -1
> 
> I'm sure there's a better way.

Are you looking for $MERGE^2? See SPECIFYING REVISIONS in git-rev-parse(1).

Björn

← back to recent threads