diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-08-18 03:02:49 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-18 03:02:50 +0300 |
commit | a555b514cd47f59b43f571eaff6b8cd7c01f0d11 (patch) | |
tree | 1e73f9b75a386aed0efaf103786e2d1d639d0284 /revision.c | |
parent | eca8c62a50e033ce6a4f4e065bb507ca3d98e75c (diff) | |
parent | 298889d3e2053cf903b01fbac902cbfb210109ea (diff) |
Merge branch 'so/log-diff-merges-opt'
Earlier, to countermand the implicit "-m" option when the
"--first-parent" option is used with "git log", we added the
"--[no-]diff-merges" option in the jk/log-fp-implies-m topic. To
leave the door open to allow the "--diff-merges" option to take
values that instructs how patches for merge commits should be
computed (e.g. "cc"? "-p against first parent?"), redefine
"--diff-merges" to take non-optional value, and implement "off"
that means the same thing as "--no-diff-merges".
* so/log-diff-merges-opt:
t/t4013: add test for --diff-merges=off
doc/git-log: describe --diff-merges=off
revision: change "--diff-merges" option to require parameter
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/revision.c b/revision.c index 97ae8f16a8..96630e3186 100644 --- a/revision.c +++ b/revision.c @@ -2343,8 +2343,15 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->diff = 1; revs->diffopt.flags.recursive = 1; revs->diffopt.flags.tree_in_recursive = 1; - } else if (!strcmp(arg, "-m") || !strcmp(arg, "--diff-merges")) { + } else if (!strcmp(arg, "-m")) { revs->ignore_merges = 0; + } else if ((argcount = parse_long_opt("diff-merges", argv, &optarg))) { + if (!strcmp(optarg, "off")) { + revs->ignore_merges = 1; + } else { + die(_("unknown value for --diff-merges: %s"), optarg); + } + return argcount; } else if (!strcmp(arg, "--no-diff-merges")) { revs->ignore_merges = 1; } else if (!strcmp(arg, "-c")) { |