Skip to content

Commit

Permalink
diff: resurrect XDF_NEED_MINIMAL with --minimal
Browse files Browse the repository at this point in the history
Earlier, 582aa00 (git diff too slow for a file, 2010-05-02)
unconditionally dropped XDF_NEED_MINIMAL option from the internal xdiff
invocation to help performance on pathological cases, while hinting that a
follow-up patch could reintroduce it with "--minimal" option from the
command line.

Make it so.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Oct 3, 2011
1 parent c5aa906 commit 81b568c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Documentation/diff-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ ifndef::git-format-patch[]
Synonym for `-p --raw`.
endif::git-format-patch[]

--minimal::
Spend extra time to make sure the smallest possible
diff is produced.

--patience::
Generate a diff using the "patience diff" algorithm.

Expand Down
4 changes: 4 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3385,6 +3385,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
}

/* xdiff options */
else 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"))
DIFF_XDL_SET(options, IGNORE_WHITESPACE);
else if (!strcmp(arg, "-b") || !strcmp(arg, "--ignore-space-change"))
Expand Down

0 comments on commit 81b568c

Please sign in to comment.