# specifying one-side of a merge commit?

3 messages from 2010-08-12 to 2010-08-12. Participants: Tay Ray Chuan, Elijah Newren, Björn Steinbrink.
Thread: https://gitlist.dev/t/24714

## Tay Ray Chuan, 2010-08-12 05:11

Subject: specifying one-side of a merge commit?
Message-ID: <AANLkTi=mnO8+XM4Bcjneaq+ngUSFesvZ_TYMRyy=f43a@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DmnO8%2BXM4Bcjneaq%2BngUSFesvZ_TYMRyy%3Df43a%40mail.gmail.com

```
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, 2010-08-12 06:01

Subject: Re: specifying one-side of a merge commit?
Message-ID: <AANLkTimT1w6o41Pu6zoLMRpv2PrtpkJ+6qLTQmQvR89d@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimT1w6o41Pu6zoLMRpv2PrtpkJ%2B6qLTQmQvR89d%40mail.gmail.com
In-Reply-To: <AANLkTi=mnO8+XM4Bcjneaq+ngUSFesvZ_TYMRyy=f43a@mail.gmail.com>

```
On Wed, Aug 11, 2010 at 11:11 PM, Tay Ray Chuan <rctay89@gmail.com> wrote:
> 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, 2010-08-12 06:11

Subject: Re: specifying one-side of a merge commit?
Message-ID: <20100812061111.GA25026@atjola.homenet>
URL: https://gitlist.dev/e/20100812061111.GA25026%40atjola.homenet
In-Reply-To: <AANLkTi=mnO8+XM4Bcjneaq+ngUSFesvZ_TYMRyy=f43a@mail.gmail.com>

```
On 2010.08.12 13:11:52 +0800, Tay Ray Chuan wrote:
> 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

```
