diff options
author | David Turner <dturner@twopensource.com> | 2015-07-08 04:29:34 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-09 20:24:23 +0300 |
commit | 076c98372e7d3c86d269c1526349a67b73904330 (patch) | |
tree | 999e92b02a98156cc486a948d43edce28b106aa8 /t/t4202-log.sh | |
parent | 5bdb7a78adf2a2656a1915e6fa656aecb45c1fc3 (diff) |
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-x | t/t4202-log.sh | 23 |
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 |