summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLibravatar David Turner <dturner@twopensource.com>2015-07-07 21:29:34 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-07-09 10:24:23 -0700
commit076c98372e7d3c86d269c1526349a67b73904330 (patch)
tree999e92b02a98156cc486a948d43edce28b106aa8 /diff.c
parentgit-multimail: update to release 1.1.1 (diff)
downloadtgif-076c98372e7d3c86d269c1526349a67b73904330.tar.xz
log: add "log.follow" configuration variable
People who work on projects with mostly linear history with frequent whole file renames may want to always use "git log --follow" when inspecting the life of the content that live in a single path. Teach the command to behave as if "--follow" was given from the command line when log.follow configuration variable is set *and* there is one (and only one) path on the command line. Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 87b16d5613..135b22231c 100644
--- a/diff.c
+++ b/diff.c
@@ -3815,9 +3815,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
DIFF_OPT_SET(options, FIND_COPIES_HARDER);
else if (!strcmp(arg, "--follow"))
DIFF_OPT_SET(options, FOLLOW_RENAMES);
- else if (!strcmp(arg, "--no-follow"))
+ else if (!strcmp(arg, "--no-follow")) {
DIFF_OPT_CLR(options, FOLLOW_RENAMES);
- else if (!strcmp(arg, "--color"))
+ DIFF_OPT_CLR(options, DEFAULT_FOLLOW_RENAMES);
+ } else if (!strcmp(arg, "--color"))
options->use_color = 1;
else if (skip_prefix(arg, "--color=", &arg)) {
int value = git_config_colorbool(NULL, arg);