diff-parseopt: convert --histogram
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
31fd640e95
commit
f1e68ef561
7
diff.c
7
diff.c
@ -5151,6 +5151,9 @@ static void prep_parse_options(struct diff_options *options)
|
|||||||
N_("generate diff using the \"patience diff\" algorithm"),
|
N_("generate diff using the \"patience diff\" algorithm"),
|
||||||
PARSE_OPT_NONEG | PARSE_OPT_NOARG,
|
PARSE_OPT_NONEG | PARSE_OPT_NOARG,
|
||||||
diff_opt_patience),
|
diff_opt_patience),
|
||||||
|
OPT_BITOP(0, "histogram", &options->xdl_opts,
|
||||||
|
N_("generate diff using the \"histogram diff\" algorithm"),
|
||||||
|
XDF_HISTOGRAM_DIFF, XDF_DIFF_ALGORITHM_MASK),
|
||||||
|
|
||||||
OPT_GROUP(N_("Diff other options")),
|
OPT_GROUP(N_("Diff other options")),
|
||||||
OPT_CALLBACK_F(0, "relative", options, N_("<prefix>"),
|
OPT_CALLBACK_F(0, "relative", options, N_("<prefix>"),
|
||||||
@ -5189,9 +5192,7 @@ int diff_opt_parse(struct diff_options *options,
|
|||||||
return ac;
|
return ac;
|
||||||
|
|
||||||
/* xdiff options */
|
/* xdiff options */
|
||||||
if (!strcmp(arg, "--histogram"))
|
if ((argcount = parse_long_opt("diff-algorithm", av, &optarg))) {
|
||||||
options->xdl_opts = DIFF_WITH_ALG(options, HISTOGRAM_DIFF);
|
|
||||||
else if ((argcount = parse_long_opt("diff-algorithm", av, &optarg))) {
|
|
||||||
long value = parse_algorithm_value(optarg);
|
long value = parse_algorithm_value(optarg);
|
||||||
if (value < 0)
|
if (value < 0)
|
||||||
return error("option diff-algorithm accepts \"myers\", "
|
return error("option diff-algorithm accepts \"myers\", "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user