]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/diff.c
builtin/diff-tree: learn --merge-base
authorDenton Liu <liu.denton@gmail.com>
Mon, 14 Sep 2020 18:36:52 +0000 (11:36 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Sep 2020 20:37:03 +0000 (13:37 -0700)
commit3d09c22869a7bd47f1683031937af0ed93b2fa3b
tree045ced9ffc692b665a5eec38611e9f75755399e4
parent0f5a1d449b9538c2765de9d6683abbb83a7fb4e2
builtin/diff-tree: learn --merge-base

The previous commit introduced ---merge-base a way to take the diff
between the working tree or index and the merge base between an arbitrary
commit and HEAD. It makes sense to extend this option to support the
case where two commits are given too and behave in a manner identical to
`git diff A...B`.

Introduce the --merge-base flag as an alternative to triple-dot
notation. Thus, we would be able to write the above as
`git diff --merge-base A B`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-diff-tree.txt
Documentation/git-diff.txt
builtin/diff-tree.c
builtin/diff.c
t/t4068-diff-symmetric-merge-base.sh