summaryrefslogtreecommitdiff
path: root/diff-merges.c
diff options
context:
space:
mode:
authorSergey Organov <sorganov@gmail.com>2021-05-20 21:47:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-21 00:24:14 (GMT)
commitf5bfcc823ba242a46e20fb6f71c9fbf7ebb222fe (patch)
tree32e15a125af7d7ed46dd4300533e7702dca3170e /diff-merges.c
parentfd16a39944ce2f2967ed015379f5bd05bac639bb (diff)
downloadgit-f5bfcc823ba242a46e20fb6f71c9fbf7ebb222fe.zip
git-f5bfcc823ba242a46e20fb6f71c9fbf7ebb222fe.tar.gz
git-f5bfcc823ba242a46e20fb6f71c9fbf7ebb222fe.tar.bz2
diff-merges: let "-m" imply "-p"
Fix long standing inconsistency between -c/--cc that do imply -p on one side, and -m that did not imply -p on the other side. Change corresponding test accordingly, as "log -m" output should now match one from "log -m -p", rather than from just "log". Change documentation accordingly. NOTES: After this patch git log -m produces diffs without need to provide -p as well, that improves both consistency and usability. It gets even more useful if one sets "log.diffMerges" configuration variable to "first-parent" to force -m produce usual diff with respect to first parent only. This patch, however, does not change behavior when specific diff format is explicitly provided on the command-line, so that commands like git log -m --raw git log -m --stat are not affected, nor does it change commands where specific diff format is active by default, such as: git diff-tree -m It's also worth to be noticed that exact historical semantics of -m is still provided by --diff-merges=separate. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-merges.c')
-rw-r--r--diff-merges.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/diff-merges.c b/diff-merges.c
index d897fd8..0dfcaa1 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;