diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-15 12:40:58 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-15 12:40:58 -0700 |
commit | 825ccfc23c7834152323586d8470666315dd4347 (patch) | |
tree | 167d5ec8fee33505252fd7dd76fa6bdeadf972ee | |
parent | 948cf4f5e546876cade022640873f92dbc2de1ee (diff) | |
parent | 0895c6d4c09045a3faeb7b652a844fc81c774631 (diff) | |
download | git-825ccfc23c7834152323586d8470666315dd4347.tar.gz git-825ccfc23c7834152323586d8470666315dd4347.tar.xz |
Merge branch 'jk/diff-algo-finishing-touches'
"git diff --diff-algorithm algo" is also understood as "git diff
--diff-algorithm=algo".
* jk/diff-algo-finishing-touches:
diff: allow unstuck arguments with --diff-algorithm
git-merge(1): document diff-algorithm option to merge-recursive
-rw-r--r-- | Documentation/merge-strategies.txt | 6 | ||||
-rw-r--r-- | diff.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Documentation/merge-strategies.txt b/Documentation/merge-strategies.txt index 66db80296..49a9a7d53 100644 --- a/Documentation/merge-strategies.txt +++ b/Documentation/merge-strategies.txt @@ -48,6 +48,12 @@ patience;; this when the branches to be merged have diverged wildly. See also linkgit:git-diff[1] `--patience`. +diff-algorithm=[patience|minimal|histogram|myers];; + Tells 'merge-recursive' to use a different diff algorithm, which + can help avoid mismerges that occur due to unimportant matching + lines (such as braces from distinct functions). See also + linkgit:git-diff[1] `--diff-algorithm`. + ignore-space-change;; ignore-all-space;; ignore-space-at-eol;; @@ -3596,8 +3596,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) options->xdl_opts = DIFF_WITH_ALG(options, PATIENCE_DIFF); else if (!strcmp(arg, "--histogram")) options->xdl_opts = DIFF_WITH_ALG(options, HISTOGRAM_DIFF); - else if (!prefixcmp(arg, "--diff-algorithm=")) { - long value = parse_algorithm_value(arg+17); + else 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\", " "\"minimal\", \"patience\" and \"histogram\""); @@ -3605,6 +3605,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) DIFF_XDL_CLR(options, NEED_MINIMAL); options->xdl_opts &= ~XDF_DIFF_ALGORITHM_MASK; options->xdl_opts |= value; + return argcount; } /* flags options */ |