summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-07-07 21:29:34 -0400
committerJunio C Hamano <gitster@pobox.com>2015-07-09 10:24:23 -0700
commit076c98372e7d3c86d269c1526349a67b73904330 (patch)
tree999e92b02a98156cc486a948d43edce28b106aa8 /t/t4202-log.sh
parent5bdb7a78adf2a2656a1915e6fa656aecb45c1fc3 (diff)
downloadgit-076c98372e7d3c86d269c1526349a67b73904330.tar.gz
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 't/t4202-log.sh')
-rwxr-xr-xt/t4202-log.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 1b2e981a00..35d2d7c221 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -146,7 +146,30 @@ test_expect_success 'git log --follow' '
actual=$(git log --follow --pretty="format:%s" ichi) &&
expect=$(echo third ; echo second ; echo initial) &&
verbose test "$actual" = "$expect"
+'
+
+test_expect_success 'git config log.follow works like --follow' '
+ test_config log.follow true &&
+ actual=$(git log --pretty="format:%s" ichi) &&
+ expect=$(echo third ; echo second ; echo initial) &&
+ verbose test "$actual" = "$expect"
+'
+test_expect_success 'git config log.follow does not die with multiple paths' '
+ test_config log.follow true &&
+ git log --pretty="format:%s" ichi ein
+'
+
+test_expect_success 'git config log.follow does not die with no paths' '
+ test_config log.follow true &&
+ git log --
+'
+
+test_expect_success 'git config log.follow is overridden by --no-follow' '
+ test_config log.follow true &&
+ actual=$(git log --no-follow --pretty="format:%s" ichi) &&
+ expect="third" &&
+ verbose test "$actual" = "$expect"
'
cat > expect << EOF