Merge branch 'mb/diff-default-to-indent-heuristics'

Make the "indent" heuristics the default in "diff" and diff.indentHeuristics
configuration variable an escape hatch for those who do no want it.

* mb/diff-default-to-indent-heuristics:
  add--interactive: drop diff.indentHeuristic handling
  diff: enable indent heuristic by default
  diff: have the diff-* builtins configure diff before initializing revisions
  diff: make the indent heuristic part of diff's basic configuration
This commit is contained in:
Junio C Hamano
2017-06-05 09:18:10 +09:00
7 changed files with 181 additions and 32 deletions

8
diff.c
View File

@ -27,7 +27,7 @@
#endif
static int diff_detect_rename_default;
static int diff_indent_heuristic; /* experimental */
static int diff_indent_heuristic = 1;
static int diff_rename_limit_default = 400;
static int diff_suppress_blank_empty;
static int diff_use_color_default = -1;
@ -290,9 +290,6 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
return 0;
}
if (git_diff_heuristic_config(var, value, cb) < 0)
return -1;
if (!strcmp(var, "diff.wserrorhighlight")) {
int val = parse_ws_error_highlight(value);
if (val < 0)
@ -351,6 +348,9 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
if (starts_with(var, "submodule."))
return parse_submodule_config_option(var, value);
if (git_diff_heuristic_config(var, value, cb) < 0)
return -1;
return git_default_config(var, value, cb);
}