summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-07-08 01:29:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-07-09 17:24:23 (GMT)
commit076c98372e7d3c86d269c1526349a67b73904330 (patch)
tree999e92b02a98156cc486a948d43edce28b106aa8 /diff.c
parent5bdb7a78adf2a2656a1915e6fa656aecb45c1fc3 (diff)
downloadgit-076c98372e7d3c86d269c1526349a67b73904330.zip
git-076c98372e7d3c86d269c1526349a67b73904330.tar.gz
git-076c98372e7d3c86d269c1526349a67b73904330.tar.bz2
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 87b16d5..135b222 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);