summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorMarc Branchaud <marcnarc@xiplink.com>2017-05-08 16:03:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-09 03:24:34 (GMT)
commitcf5e77223a012737930e1bbacc85c6423b03af77 (patch)
treeb0d9208f7c7e7850a93d6158d732409b7eea5bec /diff.c
parent027a3b943b444a3e3a76f9a89803fc10245b858f (diff)
downloadgit-cf5e77223a012737930e1bbacc85c6423b03af77.zip
git-cf5e77223a012737930e1bbacc85c6423b03af77.tar.gz
git-cf5e77223a012737930e1bbacc85c6423b03af77.tar.bz2
diff: make the indent heuristic part of diff's basic configuration
This heuristic was originally introduced as an experimental feature, and therefore part of the UI configuration. But the user often sees diffs generated by plumbing commands like diff-tree. Moving the indent heuristic into diff's basic configuration prepares the way for diff plumbing commands to respect the setting. The heuristic itself merely makes the diffs more aesthetically pleasing, without changing their correctness. Scripts that rely on the diff plumbing commands should not care whether or not the heuristic is employed. Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/diff.c b/diff.c
index 11eef1c..da96577 100644
--- a/diff.c
+++ b/diff.c
@@ -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);
}