]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/diff-index: learn --merge-base
authorDenton Liu <liu.denton@gmail.com>
Sun, 20 Sep 2020 11:22:25 +0000 (04:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Sep 2020 04:30:26 +0000 (21:30 -0700)
commit0f5a1d449b9538c2765de9d6683abbb83a7fb4e2
tree29cbd67c4138aed23542fb1030c3c718bba6ae9e
parentdf7dbab881c1aa697f0826d8d00f73d43815acf5
builtin/diff-index: learn --merge-base

There is currently no easy way to take the diff between the working tree
or index and the merge base between an arbitrary commit and HEAD. Even
diff's `...` notation doesn't allow this because it only works between
commits. However, the ability to do this would be desirable to a user
who would like to see all the changes they've made on a branch plus
uncommitted changes without taking into account changes made in the
upstream branch.

Teach diff-index and diff (with one commit) the --merge-base option
which allows a user to use the merge base of a commit and HEAD as the
"before" side.

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