summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2013-01-16 08:51:58 +0100
committerJunio C Hamano <gitster@pobox.com>2013-01-16 09:41:18 -0800
commit07924d4d50e5304fb53eb60aaba8aef31d4c4e5e (patch)
tree10760d4a006cead5202c480677f94ffac652f667 /merge-recursive.c
parent07ab4dec80f1c24660ed4bc371849fb4f11a4ee3 (diff)
downloadgit-07924d4d50e5304fb53eb60aaba8aef31d4c4e5e.tar.gz
diff: Introduce --diff-algorithm command line option
Since command line options have higher priority than config file variables and taking previous commit into account, we need a way how to specify myers algorithm on command line. However, inventing `--myers` is not the right answer. We need far more general option, and that is `--diff-algorithm`. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 33ba5dc07c..ea9dbd307c 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -2068,6 +2068,15 @@ int parse_merge_opt(struct merge_options *o, const char *s)
o->xdl_opts = DIFF_WITH_ALG(o, PATIENCE_DIFF);
else if (!strcmp(s, "histogram"))
o->xdl_opts = DIFF_WITH_ALG(o, HISTOGRAM_DIFF);
+ else if (!strcmp(s, "diff-algorithm=")) {
+ long value = parse_algorithm_value(s+15);
+ if (value < 0)
+ return -1;
+ /* clear out previous settings */
+ DIFF_XDL_CLR(o, NEED_MINIMAL);
+ o->xdl_opts &= ~XDF_DIFF_ALGORITHM_MASK;
+ o->xdl_opts |= value;
+ }
else if (!strcmp(s, "ignore-space-change"))
o->xdl_opts |= XDF_IGNORE_WHITESPACE_CHANGE;
else if (!strcmp(s, "ignore-all-space"))