diff options
author | Denton Liu <liu.denton@gmail.com> | 2020-09-20 04:22:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-20 21:30:26 -0700 |
commit | 0f5a1d449b9538c2765de9d6683abbb83a7fb4e2 (patch) | |
tree | 29cbd67c4138aed23542fb1030c3c718bba6ae9e /Documentation/git-diff-index.txt | |
parent | t4068: add --merge-base tests (diff) | |
download | tgif-0f5a1d449b9538c2765de9d6683abbb83a7fb4e2.tar.xz |
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>
Diffstat (limited to 'Documentation/git-diff-index.txt')
-rw-r--r-- | Documentation/git-diff-index.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/git-diff-index.txt b/Documentation/git-diff-index.txt index 25fe165f00..27acb31cbf 100644 --- a/Documentation/git-diff-index.txt +++ b/Documentation/git-diff-index.txt @@ -9,7 +9,7 @@ git-diff-index - Compare a tree to the working tree or index SYNOPSIS -------- [verse] -'git diff-index' [-m] [--cached] [<common diff options>] <tree-ish> [<path>...] +'git diff-index' [-m] [--cached] [--merge-base] [<common diff options>] <tree-ish> [<path>...] DESCRIPTION ----------- @@ -29,6 +29,11 @@ include::diff-options.txt[] --cached:: Do not consider the on-disk file at all. +--merge-base:: + Instead of comparing <tree-ish> directly, use the merge base + between <tree-ish> and HEAD instead. <tree-ish> must be a + commit. + -m:: By default, files recorded in the index but not checked out are reported as deleted. This flag makes |