threads / discuss / 20065

determine if one commit is an ancestor of another

Subject: determine if one commit is an ancestor of another

## tl;dr

2 messages between Jul 9, 2009 and Jul 9, 2009.

replies: 1people: 2as markdown or json

Larry D'Anna· Jul 9, 2009, 17:13 UTC · lore

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· Jul 9, 2009, 17:16 UTC · re: Larry D'Anna · lore

Re: determine if one commit is an ancestor of another

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

← back to recent threads