diff options
author | Matthieu Moy <Matthieu.Moy@imag.fr> | 2016-02-25 09:59:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-25 11:31:02 -0800 |
commit | 5404c116aa921d7e2f9408e103c80b7801735d08 (patch) | |
tree | 2a6e3a05b37e19e76242f0fdf54eba73879377f9 /builtin | |
parent | log: introduce init_log_defaults() (diff) | |
download | tgif-5404c116aa921d7e2f9408e103c80b7801735d08.tar.xz |
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 <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/commit.c | 1 | ||||
-rw-r--r-- | builtin/diff.c | 1 | ||||
-rw-r--r-- | builtin/log.c | 1 | ||||
-rw-r--r-- | builtin/merge.c | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index b3bd2d4181..109742e280 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -186,6 +186,7 @@ static void status_init_config(struct wt_status *s, config_fn_t fn) gitmodules_config(); git_config(fn, s); determine_whence(s); + init_diff_ui_defaults(); s->hints = advice_status_hints; /* must come after git_config() */ } diff --git a/builtin/diff.c b/builtin/diff.c index 52c98a9217..343c6b8f25 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -318,6 +318,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) if (!no_index) gitmodules_config(); + init_diff_ui_defaults(); git_config(git_diff_ui_config, NULL); init_revisions(&rev, prefix); diff --git a/builtin/log.c b/builtin/log.c index d83d47a9c4..9430b80e5e 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -103,6 +103,7 @@ static int log_line_range_callback(const struct option *option, const char *arg, static void init_log_defaults(void) { init_grep_defaults(); + init_diff_ui_defaults(); } static void cmd_log_init_defaults(struct rev_info *rev) diff --git a/builtin/merge.c b/builtin/merge.c index b98a3489bf..4cb4f6aa86 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1187,6 +1187,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix) else head_commit = lookup_commit_or_die(head_sha1, "HEAD"); + init_diff_ui_defaults(); git_config(git_merge_config, NULL); if (branch_mergeoptions) |