From 5404c116aa921d7e2f9408e103c80b7801735d08 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Thu, 25 Feb 2016 09:59:21 +0100 Subject: diff: activate diff.renames by default Rename detection is a very convenient feature, and new users shouldn't have to dig in the documentation to benefit from it. Potential objections to activating rename detection are that it sometimes fail, and it is sometimes slow. But rename detection is already activated by default in several cases like "git status" and "git merge", so activating diff.renames does not fundamentally change the situation. When the rename detection fails, it now fails consistently between "git diff" and "git status". This setting does not affect plumbing commands, hence well-written scripts will not be affected. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- diff.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 2136b6970b..b4dea07db9 100644 --- a/diff.c +++ b/diff.c @@ -168,6 +168,11 @@ long parse_algorithm_value(const char *value) * never be affected by the setting of diff.renames * the user happens to have in the configuration file. */ +void init_diff_ui_defaults(void) +{ + diff_detect_rename_default = 1; +} + int git_diff_ui_config(const char *var, const char *value, void *cb) { if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) { -- cgit v1.2.1