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:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-06 23:02:21 (GMT)
commit06f77518db2b6a88ffa27c7d4516840b78ee0d3a (patch)
treebe576a77bbd615d43db96b79603e523a0e61ff58 /diff.c
parent87649a1674a80a0c66b9c17977e7b54c08dd684a (diff)
downloadgit-06f77518db2b6a88ffa27c7d4516840b78ee0d3a.zip
git-06f77518db2b6a88ffa27c7d4516840b78ee0d3a.tar.gz
git-06f77518db2b6a88ffa27c7d4516840b78ee0d3a.tar.bz2
diff-parseopt: convert --[no-]indent-heuristic
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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/diff.c b/diff.c
index a63ee4a..c4cd84f 100644
--- a/diff.c
+++ b/diff.c
@@ -5124,6 +5124,9 @@ static void prep_parse_options(struct diff_options *options)
OPT_BIT_F(0, "ignore-blank-lines", &options->xdl_opts,
N_("ignore changes whose lines are all blank"),
XDF_IGNORE_BLANK_LINES, PARSE_OPT_NONEG),
+ OPT_BIT(0, "indent-heuristic", &options->xdl_opts,
+ N_("heuristic to shift diff hunk boundaries for easy reading"),
+ XDF_INDENT_HEURISTIC),
OPT_GROUP(N_("Diff other options")),
OPT_CALLBACK_F(0, "relative", options, N_("<prefix>"),
@@ -5162,11 +5165,7 @@ int diff_opt_parse(struct diff_options *options,
return ac;
/* xdiff options */
- if (!strcmp(arg, "--indent-heuristic"))
- DIFF_XDL_SET(options, INDENT_HEURISTIC);
- else if (!strcmp(arg, "--no-indent-heuristic"))
- DIFF_XDL_CLR(options, INDENT_HEURISTIC);
- else if (!strcmp(arg, "--patience")) {
+ if (!strcmp(arg, "--patience")) {
int i;
options->xdl_opts = DIFF_WITH_ALG(options, PATIENCE_DIFF);
/*