summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-03-05 12:30:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-06 23:02:21 (GMT)
commitf1e68ef5616f868cc3789625ab278e4c3ece237d (patch)
treef8525ca451a11b670beb582c3663defce0e70592 /diff.c
parent31fd640e95946782bcebbab26cb4ceba42b227ef (diff)
downloadgit-f1e68ef5616f868cc3789625ab278e4c3ece237d.zip
git-f1e68ef5616f868cc3789625ab278e4c3ece237d.tar.gz
git-f1e68ef5616f868cc3789625ab278e4c3ece237d.tar.bz2
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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/diff.c b/diff.c
index 7899c7c..7432702 100644
--- a/diff.c
+++ b/diff.c
@@ -5151,6 +5151,9 @@ static void prep_parse_options(struct diff_options *options)
N_("generate diff using the \"patience diff\" algorithm"),
PARSE_OPT_NONEG | PARSE_OPT_NOARG,
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_CALLBACK_F(0, "relative", options, N_("<prefix>"),
@@ -5189,9 +5192,7 @@ int diff_opt_parse(struct diff_options *options,
return ac;
/* xdiff options */
- if (!strcmp(arg, "--histogram"))
- options->xdl_opts = DIFF_WITH_ALG(options, HISTOGRAM_DIFF);
- else if ((argcount = parse_long_opt("diff-algorithm", av, &optarg))) {
+ if ((argcount = parse_long_opt("diff-algorithm", av, &optarg))) {
long value = parse_algorithm_value(optarg);
if (value < 0)
return error("option diff-algorithm accepts \"myers\", "