aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-diff.txt
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2022-10-01 12:28:07 +0200
committerJunio C Hamano <gitster@pobox.com>2022-10-01 15:58:38 -0700
commita79c6b60817c74534815bf132f0b26aa8e325874 (patch)
tree2286856152f99d1faa6ff41bc50689277657251e /Documentation/git-diff.txt
parent9f91da752fa28e405e91dfd6bd7372f897bbae8d (diff)
downloadgit-a79c6b60817c74534815bf132f0b26aa8e325874.tar.gz
diff: support ^! for merges
revision.c::handle_revision_arg_1() resolves <rev>^! by first adding the negated parents and then <rev> itself. builtin_diff_combined() expects the first tree to be the merge and the remaining ones to be the parents, though. This mismatch results in bogus diff output. Remember the first tree that doesn't belong to a parent and use it instead of blindly picking the first one. This makes "git diff <rev>^!" consistent with "git show <rev>^!". Reported-by: Tim Jaacks <tim.jaacks@garz-fricke.com> Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-diff.txt')
-rw-r--r--Documentation/git-diff.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 6236c75c9b..44748fa802 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -79,10 +79,10 @@ If --merge-base is given, use the merge base of the two commits for the
This form is to view the results of a merge commit. The first
listed <commit> must be the merge itself; the remaining two or
- more commits should be its parents. A convenient way to produce
- the desired set of revisions is to use the `^@` suffix.
- For instance, if `master` names a merge commit, `git diff master
- master^@` gives the same combined diff as `git show master`.
+ more commits should be its parents. Convenient ways to produce
+ the desired set of revisions are to use the suffixes `^@` and
+ `^!`. If A is a merge commit, then `git diff A A^@`,
+ `git diff A^!` and `git show A` all give the same combined diff.
'git diff' [<options>] <commit>..<commit> [--] [<path>...]::