summaryrefslogtreecommitdiff
path: root/Documentation/git-log.txt
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-29 20:12:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-29 20:44:03 (GMT)
commit5fbb4bc1910f76b344fcb88df2544701b6030435 (patch)
tree6c2aac115183f67883ff51d3c51cd2a930a59d2d /Documentation/git-log.txt
parent9a6d515fc38abc36a94228f2b96813e1b07c0059 (diff)
downloadgit-5fbb4bc1910f76b344fcb88df2544701b6030435.zip
git-5fbb4bc1910f76b344fcb88df2544701b6030435.tar.gz
git-5fbb4bc1910f76b344fcb88df2544701b6030435.tar.bz2
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>
Diffstat (limited to 'Documentation/git-log.txt')
-rw-r--r--Documentation/git-log.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 0a4c99e..9ccba65 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -117,6 +117,13 @@ DIFF FORMATTING
By default, `git log` does not generate any diff output. The options
below can be used to show the changes made by each commit.
+Note that unless one of `-c`, `--cc`, or `-m` is given, merge commits
+will never show a diff, even if a diff format like `--patch` is
+selected, nor will they match search options like `-S`. The exception is
+when `--first-parent` is in use, in which merges are treated like normal
+single-parent commits (this can be overridden by providing a
+combined-diff option or with `--no-diff-merges`).
+
-c::
With this option, diff output for a merge commit
shows the differences from each of the parents to the merge result