@matheusbsbs / matheus-bagliano / commits / 5fbb4bc191
Fork 0

doc/git-log: clarify handling of merge commit diffs

It can be surprising that git-log doesn't show any diff for merge commits by default. Arguably "--cc" would be a reasonable default, but it's very expensive (which is why we turn it on for "git show" but not for "git log"). Let's at least document the current behavior, including the recent "--first-parent implies -m" case Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jul 29, 2020 at 16:12 UTC 5fbb4bc1910f76b344fcb88df2544701b6030435
1 file changed +7
Documentation/git-log.txt
+7
@@ -117,6 +117,13 @@ DIFF FORMATTING
117 By default, `git log` does not generate any diff output. The options
118 below can be used to show the changes made by each commit.
119
120 +Note that unless one of `-c`, `--cc`, or `-m` is given, merge commits
121 +will never show a diff, even if a diff format like `--patch` is
122 +selected, nor will they match search options like `-S`. The exception is
123 +when `--first-parent` is in use, in which merges are treated like normal
124 +single-parent commits (this can be overridden by providing a
125 +combined-diff option or with `--no-diff-merges`).
126 +
127 -c::
128 With this option, diff output for a merge commit
129 shows the differences from each of the parents to the merge result