diff options
authorGravatar Junio C Hamano <gitster@pobox.com> 2021-08-11 12:36:18 -0700
committerGravatar Junio C Hamano <gitster@pobox.com> 2021-08-11 12:36:18 -0700
commit4c90d8908ac0c7ec9cd8d2caee7a1a0394636612 (patch)
parent7cfaa86fe6f61698752d13c59ac97a102d1fbaae (diff)
parent6a38e33331560c3e84123c567f95de72d1cfa506 (diff)
Merge branch 'jn/log-m-does-not-imply-p'
Earlier "git log -m" was changed to always produce patch output, which would break existing scripts, which has been reverted. * jn/log-m-does-not-imply-p: Revert 'diff-merges: let "-m" imply "-p"'
3 files changed, 6 insertions, 7 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 0aebe83205..c89d530d3d 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -49,9 +49,10 @@ ifdef::git-log[]
This option makes diff output for merge commits to be shown in
- the default format. The default format could be changed using
+ the default format. `-m` will produce the output only if `-p`
+ is given as well. The default format could be changed using
`log.diffMerges` configuration parameter, which default value
- is `separate`. `-m` implies `-p`.
+ is `separate`.
@@ -61,8 +62,7 @@ ifdef::git-log[]
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. This is the format that `-m` produced
- historically.
+ for each parent.
diff --git a/diff-merges.c b/diff-merges.c
index 0dfcaa1b11..d897fd8a29 100644
--- a/diff-merges.c
+++ b/diff-merges.c
@@ -107,7 +107,6 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
if (!strcmp(arg, "-m")) {
- revs->merges_imply_patch = 1;
} else if (!strcmp(arg, "-c")) {
revs->merges_imply_patch = 1;
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 7fadc985cc..e561a8e485 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
-test_expect_success 'log -m matches log -m -p' '
- git log -m -p master >result &&
+test_expect_success 'log -m matches pure log' '
+ git log master >result &&
process_diffs result >expected &&
git log -m >result &&
process_diffs result >actual &&