summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/diff-options.txt8
-rw-r--r--diff-merges.c1
-rwxr-xr-xt/t4013-diff-various.sh4
3 files changed, 7 insertions, 6 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 6d968b9012..2825783049 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -49,10 +49,9 @@ ifdef::git-log[]
--diff-merges=m:::
-m:::
This option makes diff output for merge commits to be shown in
- the default format. `-m` will produce the output only if `-p`
- is given as well. The default format could be changed using
+ the default format. The default format could be changed using
`log.diffMerges` configuration parameter, which default value
- is `separate`.
+ is `separate`. `-m` implies `-p`.
+
--diff-merges=first-parent:::
--diff-merges=1:::
@@ -62,7 +61,8 @@ ifdef::git-log[]
--diff-merges=separate:::
This makes merge commits show the full diff with respect to
each of the parents. Separate log entry and diff is generated
- for each parent.
+ for each parent. This is the format that `-m` produced
+ historically.
+
--diff-merges=combined:::
--diff-merges=c:::
diff --git a/diff-merges.c b/diff-merges.c
index d897fd8a29..0dfcaa1b11 100644
--- a/diff-merges.c
+++ b/diff-merges.c
@@ -107,6 +107,7 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
if (!strcmp(arg, "-m")) {
set_to_default(revs);
+ revs->merges_imply_patch = 1;
} else if (!strcmp(arg, "-c")) {
set_combined(revs);
revs->merges_imply_patch = 1;
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index e561a8e485..7fadc985cc 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -455,8 +455,8 @@ diff-tree --stat --compact-summary initial mode
diff-tree -R --stat --compact-summary initial mode
EOF
-test_expect_success 'log -m matches pure log' '
- git log master >result &&
+test_expect_success 'log -m matches log -m -p' '
+ git log -m -p master >result &&
process_diffs result >expected &&
git log -m >result &&
process_diffs result >actual &&