Skip to content

Commit

Permalink
Merge branch 'jn/log-m-does-not-imply-p'
Browse files Browse the repository at this point in the history
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"'
  • Loading branch information
gitster committed Aug 11, 2021
2 parents 7cfaa86 + 6a38e33 commit 4c90d89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Documentation/diff-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ ifdef::git-log[]
--diff-merges=m:::
-m:::
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`.
+
--diff-merges=first-parent:::
--diff-merges=1:::
Expand All @@ -61,8 +62,7 @@ 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. This is the format that `-m` produced
historically.
for each parent.
+
--diff-merges=combined:::
--diff-merges=c:::
Expand Down
1 change: 0 additions & 1 deletion diff-merges.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ 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;
Expand Down
4 changes: 2 additions & 2 deletions t/t4013-diff-various.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 &&
Expand Down

0 comments on commit 4c90d89

Please sign in to comment.