]> git.ipfire.org Git - thirdparty/git.git/commit - Documentation/git-merge-base.txt
merge-base: "--is-ancestor A B"
authorJunio C Hamano <gitster@pobox.com>
Thu, 30 Aug 2012 21:52:20 +0000 (14:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Aug 2012 18:45:33 +0000 (11:45 -0700)
commit5907cda1b2e0bd7dc5c26466f60b9cbb60288cc5
tree37738a51fd16874f47f6b978ef37aa1a2db00751
parent94f0ced0d08c8f835992b82224231b9353490e0c
merge-base: "--is-ancestor A B"

In many scripted Porcelain commands, we find this idiom:

    if test "$(git rev-parse --verify A)" = "$(git merge-base A B)"
    then
     ... A is an ancestor of B ...
    fi

But you do not have to compute exact merge-base only to see if A is
an ancestor of B.  Give them a more direct way to use the underlying
machinery.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-merge-base.txt
builtin/merge-base.c