# determine if one commit is an ancestor of another

2 messages from 2009-07-09 to 2009-07-09. Participants: Larry D'Anna, Johannes Schindelin.
Thread: https://gitlist.dev/t/20065

## Larry D'Anna, 2009-07-09 17:13

Subject: determine if one commit is an ancestor of another
Message-ID: <20090709171351.GA30088@cthulhu>
URL: https://gitlist.dev/e/20090709171351.GA30088%40cthulhu

```
Is there any builtin to do this?  I'm doing it in a perl script now by parsing
git log --pretty=raw, but it's pretty slow for a big repository.

    --larry

```

## Johannes Schindelin, 2009-07-09 17:16

Subject: Re: determine if one commit is an ancestor of another
Message-ID: <alpine.DEB.1.00.0907091916090.4339@intel-tinevez-2-302>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0907091916090.4339%40intel-tinevez-2-302
In-Reply-To: <20090709171351.GA30088@cthulhu>

```
Hi,

On Thu, 9 Jul 2009, Larry D'Anna wrote:

> Is there any builtin to do this?  I'm doing it in a perl script now by 
> parsing git log --pretty=raw, but it's pretty slow for a big repository.

test $ancestor = $(git merge-base $ancestor $descendant)

Ciao,
Dscho

```
