3 # emulates git merge-base --is-ancestor
4 # until git >= 1.8 is prevalent
6 ## Check if the first <commit> is an ancestor of the second <commit>,
7 ## and exit with status 0 if true, or with status 1 if not.
8 ## Errors are signaled by a non-zero status that is not 1.
13 # they may be symbolic, a refname or a pointer to a full tag,
14 # make sure we resolve to sha1 of the commit
15 PARENT
=$
(git rev-parse
--revs-only ${PARENT}^
{commit
} ) ||
exit 1
16 CHILD
=$
(git rev-parse
--revs-only ${CHILD}^
{commit
} ) ||
exit 1
18 MB
=$
(git merge-base
$PARENT $CHILD) ||
exit 1
20 if [ "$MB" = "$PARENT" ]; then