test prerequisites: enumerate with commas
[gitweb.git] / t / t4202-log.sh
index fa686b887d6b49ab8e6d30893501744645f72a91..99ab7ca21f2673e646232d9c07f77c8ed2f5f998 100755 (executable)
@@ -3,6 +3,7 @@
 test_description='git log'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY/lib-gpg.sh"
 
 test_expect_success setup '
 
@@ -419,8 +420,6 @@ test_expect_success 'log --graph with merge' '
 '
 
 test_expect_success 'log.decorate configuration' '
-       test_might_fail git config --unset-all log.decorate &&
-
        git log --oneline >expect.none &&
        git log --oneline --decorate >expect.short &&
        git log --oneline --decorate=full >expect.full &&
@@ -429,8 +428,7 @@ test_expect_success 'log.decorate configuration' '
        git log --oneline >actual &&
        test_cmp expect.short actual &&
 
-       git config --unset-all log.decorate &&
-       git config log.decorate true &&
+       test_config log.decorate true &&
        git log --oneline >actual &&
        test_cmp expect.short actual &&
        git log --oneline --decorate=full >actual &&
@@ -438,8 +436,7 @@ test_expect_success 'log.decorate configuration' '
        git log --oneline --decorate=no >actual &&
        test_cmp expect.none actual &&
 
-       git config --unset-all log.decorate &&
-       git config log.decorate no &&
+       test_config log.decorate no &&
        git log --oneline >actual &&
        test_cmp expect.none actual &&
        git log --oneline --decorate >actual &&
@@ -447,8 +444,7 @@ test_expect_success 'log.decorate configuration' '
        git log --oneline --decorate=full >actual &&
        test_cmp expect.full actual &&
 
-       git config --unset-all log.decorate &&
-       git config log.decorate 1 &&
+       test_config log.decorate 1 &&
        git log --oneline >actual &&
        test_cmp expect.short actual &&
        git log --oneline --decorate=full >actual &&
@@ -456,8 +452,7 @@ test_expect_success 'log.decorate configuration' '
        git log --oneline --decorate=no >actual &&
        test_cmp expect.none actual &&
 
-       git config --unset-all log.decorate &&
-       git config log.decorate short &&
+       test_config log.decorate short &&
        git log --oneline >actual &&
        test_cmp expect.short actual &&
        git log --oneline --no-decorate >actual &&
@@ -465,8 +460,7 @@ test_expect_success 'log.decorate configuration' '
        git log --oneline --decorate=full >actual &&
        test_cmp expect.full actual &&
 
-       git config --unset-all log.decorate &&
-       git config log.decorate full &&
+       test_config log.decorate full &&
        git log --oneline >actual &&
        test_cmp expect.full actual &&
        git log --oneline --no-decorate >actual &&
@@ -474,16 +468,15 @@ test_expect_success 'log.decorate configuration' '
        git log --oneline --decorate >actual &&
        test_cmp expect.short actual
 
-       git config --unset-all log.decorate &&
+       test_unconfig log.decorate &&
        git log --pretty=raw >expect.raw &&
-       git config log.decorate full &&
+       test_config log.decorate full &&
        git log --pretty=raw >actual &&
        test_cmp expect.raw actual
 
 '
 
 test_expect_success 'reflog is expected format' '
-       test_might_fail git config --remove-section log &&
        git log -g --abbrev-commit --pretty=oneline >expect &&
        git reflog >actual &&
        test_cmp expect actual
@@ -496,10 +489,6 @@ test_expect_success 'whatchanged is expected format' '
 '
 
 test_expect_success 'log.abbrevCommit configuration' '
-       test_when_finished "git config --unset log.abbrevCommit" &&
-
-       test_might_fail git config --unset log.abbrevCommit &&
-
        git log --abbrev-commit >expect.log.abbrev &&
        git log --no-abbrev-commit >expect.log.full &&
        git log --pretty=raw >expect.log.raw &&
@@ -508,7 +497,7 @@ test_expect_success 'log.abbrevCommit configuration' '
        git whatchanged --abbrev-commit >expect.whatchanged.abbrev &&
        git whatchanged --no-abbrev-commit >expect.whatchanged.full &&
 
-       git config log.abbrevCommit true &&
+       test_config log.abbrevCommit true &&
 
        git log >actual &&
        test_cmp expect.log.abbrev actual &&
@@ -542,6 +531,20 @@ test_expect_success 'show added path under "--follow -M"' '
        )
 '
 
+test_expect_success 'git log -c --follow' '
+       test_create_repo follow-c &&
+       (
+               cd follow-c &&
+               test_commit initial file original &&
+               git rm file &&
+               test_commit rename file2 original &&
+               git reset --hard initial &&
+               test_commit modify file foo &&
+               git merge -m merge rename &&
+               git log -c --follow file2
+       )
+'
+
 cat >expect <<\EOF
 *   commit COMMIT_OBJECT_NAME
 |\  Merge: MERGE_PARENTS
@@ -839,4 +842,34 @@ test_expect_success 'dotdot is a parent directory' '
        test_cmp expect actual
 '
 
+test_expect_success GPG 'log --graph --show-signature' '
+       test_when_finished "git reset --hard && git checkout master" &&
+       git checkout -b signed master &&
+       echo foo >foo &&
+       git add foo &&
+       git commit -S -m signed_commit &&
+       git log --graph --show-signature -n1 signed >actual &&
+       grep "^| gpg: Signature made" actual &&
+       grep "^| gpg: Good signature" actual
+'
+
+test_expect_success GPG 'log --graph --show-signature for merged tag' '
+       test_when_finished "git reset --hard && git checkout master" &&
+       git checkout -b plain master &&
+       echo aaa >bar &&
+       git add bar &&
+       git commit -m bar_commit &&
+       git checkout -b tagged master &&
+       echo bbb >baz &&
+       git add baz &&
+       git commit -m baz_commit &&
+       git tag -s -m signed_tag_msg signed_tag &&
+       git checkout plain &&
+       git merge --no-ff -m msg signed_tag &&
+       git log --graph --show-signature -n1 plain >actual &&
+       grep "^|\\\  merged tag" actual &&
+       grep "^| | gpg: Signature made" actual &&
+       grep "^| | gpg: Good signature" actual
+'
+
 test_done