Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-02-21 14:16:20 +0300
committerJunio C Hamano <gitster@pobox.com>2019-02-22 02:16:59 +0300
commit2e75f922f3ee73a1ff9c232c11c82c6006ebeb1d (patch)
treeefc9efa5861d9652b68799319939f471d582f045 /diff.c
parent0b1c5b59f0507e428485c7d843c11d6085555db0 (diff)
diff-parseopt: convert --[no-]minimal
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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/diff.c b/diff.c
index b9c267a199..33492e754f 100644
--- a/diff.c
+++ b/diff.c
@@ -5105,6 +5105,11 @@ static void prep_parse_options(struct diff_options *options)
OPT_BOOL(0, "rename-empty", &options->flags.rename_empty,
N_("use empty blobs as rename source")),
+ OPT_GROUP(N_("Diff algorithm options")),
+ OPT_BIT(0, "minimal", &options->xdl_opts,
+ N_("produce the smallest possible diff"),
+ XDF_NEED_MINIMAL),
+
OPT_GROUP(N_("Diff other options")),
OPT_CALLBACK_F(0, "relative", options, N_("<prefix>"),
N_("when run from subdir, exclude changes outside and show relative paths"),
@@ -5142,11 +5147,7 @@ int diff_opt_parse(struct diff_options *options,
return ac;
/* xdiff options */
- if (!strcmp(arg, "--minimal"))
- DIFF_XDL_SET(options, NEED_MINIMAL);
- else if (!strcmp(arg, "--no-minimal"))
- DIFF_XDL_CLR(options, NEED_MINIMAL);
- else if (!strcmp(arg, "-w") || !strcmp(arg, "--ignore-all-space"))
+ if (!strcmp(arg, "-w") || !strcmp(arg, "--ignore-all-space"))
DIFF_XDL_SET(options, IGNORE_WHITESPACE);
else if (!strcmp(arg, "-b") || !strcmp(arg, "--ignore-space-change"))
DIFF_XDL_SET(options, IGNORE_WHITESPACE_CHANGE);