range-diff: introduce the convenience option --remerge-diff

Just like `git log`, now also `git range-diff` has that option as a
shortcut for the common operation that would otherwise require the quite
unwieldy (if theoretically "more correct") `--diff-mode=remerge` option.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin 2024-12-16 14:11:22 +00:00 committed by Junio C Hamano
parent f8043236c6
commit 4538338c7e
2 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ SYNOPSIS
'git range-diff' [--color=[<when>]] [--no-color] [<diff-options>] 'git range-diff' [--color=[<when>]] [--no-color] [<diff-options>]
[--no-dual-color] [--creation-factor=<factor>] [--no-dual-color] [--creation-factor=<factor>]
[--left-only | --right-only] [--diff-merges=<format>] [--left-only | --right-only] [--diff-merges=<format>]
[--remerge-diff]
( <range1> <range2> | <rev1>...<rev2> | <base> <rev1> <rev2> ) ( <range1> <range2> | <rev1>...<rev2> | <base> <rev1> <rev2> )
[[--] <path>...] [[--] <path>...]
@ -92,6 +93,9 @@ have produced. In other words, if a merge commit is the result of a
non-conflicting `git merge`, the `remerge` mode will represent it with an empty non-conflicting `git merge`, the `remerge` mode will represent it with an empty
diff. diff.
--remerge-diff::
Convenience option, equivalent to `--diff-merges=remerge`.
--[no-]notes[=<ref>]:: --[no-]notes[=<ref>]::
This flag is passed to the `git log` program This flag is passed to the `git log` program
(see linkgit:git-log[1]) that generates the patches. (see linkgit:git-log[1]) that generates the patches.

View File

@ -39,6 +39,8 @@ int cmd_range_diff(int argc,
PARSE_OPT_OPTARG), PARSE_OPT_OPTARG),
OPT_PASSTHRU_ARGV(0, "diff-merges", &diff_merges_arg, OPT_PASSTHRU_ARGV(0, "diff-merges", &diff_merges_arg,
N_("style"), N_("passed to 'git log'"), 0), N_("style"), N_("passed to 'git log'"), 0),
OPT_PASSTHRU_ARGV(0, "remerge-diff", &diff_merges_arg, NULL,
N_("passed to 'git log'"), PARSE_OPT_NOARG),
OPT_BOOL(0, "left-only", &left_only, OPT_BOOL(0, "left-only", &left_only,
N_("only emit output related to the first range")), N_("only emit output related to the first range")),
OPT_BOOL(0, "right-only", &right_only, OPT_BOOL(0, "right-only", &right_only,