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>
This commit is contained in:

committed by
Junio C Hamano

parent
07ab4dec80
commit
07924d4d50
@ -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"))
|
||||
|
Reference in New Issue
Block a user