diff-merges: fix -m to properly override -c/--cc

Logically, -m, -c, --cc specify 3 different formats for representing
merge commits, yet -m doesn't in fact override -c or --cc, that makes
no sense.

Fix -m to properly override -c/--cc, and change the tests accordingly.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Sergey Organov 2020-12-21 18:19:45 +03:00 committed by Junio C Hamano
parent ec315c66bb
commit 6fc944d895
2 changed files with 3 additions and 2 deletions

View File

@ -33,6 +33,7 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
const char *arg = argv[0]; const char *arg = argv[0];
if (!strcmp(arg, "-m")) { if (!strcmp(arg, "-m")) {
suppress(revs);
/* /*
* To "diff-index", "-m" means "match missing", and to the "log" * To "diff-index", "-m" means "match missing", and to the "log"
* family of commands, it means "show full diff for merges". Set * family of commands, it means "show full diff for merges". Set

View File

@ -329,8 +329,8 @@ log --first-parent --diff-merges=off -p master
log -p --first-parent master log -p --first-parent master
log -m -p --first-parent master log -m -p --first-parent master
log -m -p master log -m -p master
:failure log --cc -m -p master log --cc -m -p master
:failure log -c -m -p master log -c -m -p master
log -SF master log -SF master
log -S F master log -S F master
log -SF -p master log -SF -p master