{"thread":{"id":"55929","subject":"[PATCH 1/6] mktag tests: parse out options in helper","startedAt":"2021-06-14T17:28:30Z","lastAt":"2021-06-17T10:42:17Z","messageCount":17,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano","Andrei Rybak"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"427371","messageId":"patch-1.6-d49549973d3-20210614T172422Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"[PATCH 1/6] mktag tests: parse out options in helper","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T17:28:18Z","receivedAt":"2021-06-14T17:28:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change check_verify_failure() helper to parse out options from\n$@. This makes it easier to add new options in the future. See\n06ce79152be (mktag: add a --[no-]strict option, 2021-01-06) for the\ninitial implementation.\n\nLet's also replace \"\" quotes with '' for the test body, the varables\nwe need are eval'd into the body, so there's no need for the quoting\nconfusion.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 43 +++++++++++++++++++++++++++++++------------\n 1 file changed, 31 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 6275c98523f..e9008744e3d 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -12,15 +12,29 @@ test_description='git mktag: tag object verify test'\n # given in the expect.pat file.\n \n check_verify_failure () {\n-\ttest_expect_success \"$1\" \"\n-\t\ttest_must_fail git mktag <tag.sig 2>message &&\n-\t\tgrep '$2' message &&\n-\t\tif test '$3' != '--no-strict'\n+\tsubject=$1 &&\n+\tmessage=$2 &&\n+\tshift 2 &&\n+\n+\tno_strict= &&\n+\twhile test $# != 0\n+\tdo\n+\t\tcase \"$1\" in\n+\t\t--no-strict)\n+\t\t\tno_strict=yes\n+\t\t\t;;\n+\t\tesac &&\n+\t\tshift\n+\tdone &&\n+\n+\ttest_expect_success \"fail with [--[no-]strict]: $subject\" '\n+\t\ttest_must_fail git mktag <tag.sig 2>err &&\n+\t\tif test -z \"$no_strict\"\n \t\tthen\n-\t\t\ttest_must_fail git mktag --no-strict <tag.sig 2>message.no-strict &&\n-\t\t\tgrep '$2' message.no-strict\n+\t\t\ttest_must_fail git mktag <tag.sig 2>err2 &&\n+\t\t\ttest_cmp err err2\n \t\tfi\n-\t\"\n+\t'\n }\n \n test_expect_mktag_success() {\n@@ -243,7 +257,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify tag-name check' \\\n-\t'^error:.* badTagName:' '--no-strict'\n+\t'^error:.* badTagName:' \\\n+\t--no-strict\n \n ############################################################\n # 11. tagger line label check #1\n@@ -257,7 +272,8 @@ This is filler\n EOF\n \n check_verify_failure '\"tagger\" line label check #1' \\\n-\t'^error:.* missingTaggerEntry:' '--no-strict'\n+\t'^error:.* missingTaggerEntry:' \\\n+\t--no-strict\n \n ############################################################\n # 12. tagger line label check #2\n@@ -272,7 +288,8 @@ This is filler\n EOF\n \n check_verify_failure '\"tagger\" line label check #2' \\\n-\t'^error:.* missingTaggerEntry:' '--no-strict'\n+\t'^error:.* missingTaggerEntry:' \\\n+\t--no-strict\n \n ############################################################\n # 13. allow missing tag author name like fsck\n@@ -301,7 +318,8 @@ tagger T A Gger <\n EOF\n \n check_verify_failure 'disallow malformed tagger' \\\n-\t'^error:.* badEmail:' '--no-strict'\n+\t'^error:.* badEmail:' \\\n+\t--no-strict\n \n ############################################################\n # 15. allow empty tag email\n@@ -425,7 +443,8 @@ this line should not be here\n EOF\n \n check_verify_failure 'detect invalid header entry' \\\n-\t'^error:.* extraHeaderEntry:' '--no-strict'\n+\t'^error:.* extraHeaderEntry:' \\\n+\t--no-strict\n \n test_expect_success 'invalid header entry config & fsck' '\n \ttest_must_fail git mktag <tag.sig &&\n-- \n2.32.0.555.g0268d380f7b\n\n"},{"id":"427372","messageId":"patch-4.6-0359becdc92-20210614T172422Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"[PATCH 4/6] mktag tests: test update-ref and reachable fsck","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T17:28:21Z","receivedAt":"2021-06-14T17:28:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Extend the mktag tests to pass the created bad tag through update-ref\nand fsck.\n\nThe reason for passing it through update-ref is to guard against it\nhaving a segfault as for-each-ref did before c6854508808 (ref-filter:\nfix NULL check for parse object failure, 2021-04-01).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 43b67a149f8..f5a51d11f81 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -44,6 +44,8 @@ check_verify_failure () {\n \t'\n \n \ttest_expect_success \"setup: $subject\" '\n+\t\ttag_ref=refs/tags/bad_tag &&\n+\n \t\t# Reset any leftover state from the last $subject\n \t\trm -rf bad-tag &&\n \n@@ -59,6 +61,20 @@ check_verify_failure () {\n \t\t\ttest_must_fail git -C bad-tag fsck >out 2>err\n \t\tfi\n \t'\n+\n+\ttest_expect_success \"update-ref & fsck reachable: $subject\" '\n+\t\t# The update-ref of the bad content will fail, do it\n+\t\t# anyway to see if it segfaults\n+\t\ttest_might_fail git -C bad-tag update-ref \"$tag_ref\" \"$bad_tag\" &&\n+\n+\t\t# Manually create the broken, we cannot do it with\n+\t\t# update-ref\n+\t\techo \"$bad_tag\" >\"bad-tag/$tag_ref\" &&\n+\n+\t\t# Unlike fsck-ing unreachable content above, this\n+\t\t# will always fail.\n+\t\ttest_must_fail git -C bad-tag fsck\n+\t'\n }\n \n test_expect_mktag_success() {\n-- \n2.32.0.555.g0268d380f7b\n\n"},{"id":"427373","messageId":"patch-3.6-96520b3e89a-20210614T172422Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"[PATCH 3/6] mktag tests: test hash-object --literally and unreachable fsck","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T17:28:20Z","receivedAt":"2021-06-14T17:28:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Extend the mktag tests to pass the tag we've created through both\nhash-object --literally and fsck.\n\nThis checks that fsck itself will not complain about certain invalid\ncontent if a reachable tip isn't involved. Due to how fsck works and\nwalks the graph the failure will be different if the object is\nreachable, so we might succeed before we've created the ref.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 48 +++++++++++++++++++++++++++++++++++++++---------\n 1 file changed, 39 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 951e6d39c2a..43b67a149f8 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -16,6 +16,8 @@ check_verify_failure () {\n \tmessage=$2 &&\n \tshift 2 &&\n \n+\tno_strict= &&\n+\tfsck_obj_ok= &&\n \tno_strict= &&\n \twhile test $# != 0\n \tdo\n@@ -23,7 +25,10 @@ check_verify_failure () {\n \t\t--no-strict)\n \t\t\tno_strict=yes\n \t\t\t;;\n-\t\tesac &&\n+\t\t--fsck-obj-ok)\n+\t\t\tfsck_obj_ok=yes\n+\t\t\t;;\n+\t\tesac\n \t\tshift\n \tdone &&\n \n@@ -37,6 +42,23 @@ check_verify_failure () {\n \t\t\tgit mktag --no-strict <tag.sig\n \t\tfi\n \t'\n+\n+\ttest_expect_success \"setup: $subject\" '\n+\t\t# Reset any leftover state from the last $subject\n+\t\trm -rf bad-tag &&\n+\n+\t\tgit init --bare bad-tag &&\n+\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n+\t'\n+\n+\ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n+\t\tif test -n \"$fsck_obj_ok\"\n+\t\tthen\n+\t\t\tgit -C bad-tag fsck\n+\t\telse\n+\t\t\ttest_must_fail git -C bad-tag fsck >out 2>err\n+\t\tfi\n+\t'\n }\n \n test_expect_mktag_success() {\n@@ -183,7 +205,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify object (hash/type) check -- correct type, nonexisting object' \\\n-\t'^fatal: could not read tagged object'\n+\t'^fatal: could not read tagged object' \\\n+\t--fsck-obj-ok\n \n cat >tag.sig <<EOF\n object $head\n@@ -216,7 +239,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify object (hash/type) check -- mismatched type, valid object' \\\n-\t'^fatal: object.*tagged as.*tree.*but is.*commit'\n+\t'^fatal: object.*tagged as.*tree.*but is.*commit' \\\n+\t--fsck-obj-ok\n \n ############################################################\n #  9.5. verify object (hash/type) check -- replacement\n@@ -245,7 +269,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify object (hash/type) check -- mismatched type, valid object' \\\n-\t'^fatal: object.*tagged as.*tree.*but is.*blob'\n+\t'^fatal: object.*tagged as.*tree.*but is.*blob' \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 10. verify tag-name check\n@@ -260,7 +285,8 @@ EOF\n \n check_verify_failure 'verify tag-name check' \\\n \t'^error:.* badTagName:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 11. tagger line label check #1\n@@ -275,7 +301,8 @@ EOF\n \n check_verify_failure '\"tagger\" line label check #1' \\\n \t'^error:.* missingTaggerEntry:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 12. tagger line label check #2\n@@ -291,7 +318,8 @@ EOF\n \n check_verify_failure '\"tagger\" line label check #2' \\\n \t'^error:.* missingTaggerEntry:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 13. allow missing tag author name like fsck\n@@ -321,7 +349,8 @@ EOF\n \n check_verify_failure 'disallow malformed tagger' \\\n \t'^error:.* badEmail:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 15. allow empty tag email\n@@ -446,7 +475,8 @@ EOF\n \n check_verify_failure 'detect invalid header entry' \\\n \t'^error:.* extraHeaderEntry:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n test_expect_success 'invalid header entry config & fsck' '\n \ttest_must_fail git mktag <tag.sig &&\n-- \n2.32.0.555.g0268d380f7b\n\n"},{"id":"427374","messageId":"patch-2.6-550dcedfcb8-20210614T172422Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"[PATCH 2/6] mktag tests: invert --no-strict test","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T17:28:19Z","receivedAt":"2021-06-14T17:28:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the mktag --no-strict test to actually test success under\n--no-strict, that test was added in 06ce79152be (mktag: add a\n--[no-]strict option, 2021-01-06).\n\nIt doesn't make sense to check that we have the same failure except\nwhen we want --no-strict, by doing that we're assuming that the\nbehavior will be different under --no-strict, bun nothing was testing\nfor that.\n\nWe should instead assert that --strict is the same as --no-strict,\nexcept in the cases where we've declared that it's not.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex e9008744e3d..951e6d39c2a 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -33,6 +33,8 @@ check_verify_failure () {\n \t\tthen\n \t\t\ttest_must_fail git mktag <tag.sig 2>err2 &&\n \t\t\ttest_cmp err err2\n+\t\telse\n+\t\t\tgit mktag --no-strict <tag.sig\n \t\tfi\n \t'\n }\n-- \n2.32.0.555.g0268d380f7b\n\n"},{"id":"427375","messageId":"patch-6.6-6d613d88acc-20210614T172422Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"[PATCH 6/6] mktag tests: test fast-export","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T17:28:23Z","receivedAt":"2021-06-14T17:28:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Pass the bad tags we've created in the mktag tests through\nfast-export, it will die on the bad object or ref, let's make sure\nthat happens.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 7d0ad3c8e62..ad0da2cd2b2 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -85,6 +85,11 @@ check_verify_failure () {\n \n \t\ttest_must_fail git -C bad-tag for-each-ref --format=\"%(*objectname)\"\n \t'\n+\n+\ttest_expect_success \"fast-export & fast-import: $subject\" '\n+\t\ttest_must_fail git -C bad-tag fast-export --all &&\n+\t\ttest_must_fail git -C bad-tag fast-export $bad_tag\n+\t'\n }\n \n test_expect_mktag_success() {\n-- \n2.32.0.555.g0268d380f7b\n\n"},{"id":"427376","messageId":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","threadId":"55929","inReplyTo":null,"subject":"[PATCH 0/6] mktag tests: test more exhaustively","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T17:28:17Z","receivedAt":"2021-06-14T17:29:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"In [1] I suggested that we could catch the segfault fixed in\nc6854508808 (ref-filter: fix NULL check for parse object failure,\n2021-04-01) (and possibly other future bugs) my extending the mktag\ntests.\n\nJunio wanted the more isolated bug fix first[2], which is fair\nenough. But now that the dust has settled I figured I'd submit this\ntest-only series which stresses mktag, fsck and various commands that\nmight deal with the broken objects the mktag tests creates.\n\n1. https://lore.kernel.org/git/cover-0.6-00000000000-20210401T135419Z-avarab@gmail.com/\n2. https://lore.kernel.org/git/xmqqeefs4dge.fsf@gitster.g/\n\nÆvar Arnfjörð Bjarmason (6):\n  mktag tests: parse out options in helper\n  mktag tests: invert --no-strict test\n  mktag tests: test hash-object --literally and unreachable fsck\n  mktag tests: test update-ref and reachable fsck\n  mktag tests: test for-each-ref\n  mktag tests: test fast-export\n\n t/t3800-mktag.sh | 112 ++++++++++++++++++++++++++++++++++++++++-------\n 1 file changed, 97 insertions(+), 15 deletions(-)\n\n-- \n2.32.0.555.g0268d380f7b\n\n"},{"id":"427377","messageId":"patch-5.6-8a626fc63a1-20210614T172422Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"[PATCH 5/6] mktag tests: test for-each-ref","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-14T17:28:22Z","receivedAt":"2021-06-14T17:29:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a \"for-each-ref\" for all the mktag tests. This test would have\ncaught the segfault which was fixed in c6854508808 (ref-filter: fix\nNULL check for parse object failure, 2021-04-01). Let's make sure we\ntest that code more exhaustively.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex f5a51d11f81..7d0ad3c8e62 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -50,7 +50,7 @@ check_verify_failure () {\n \t\trm -rf bad-tag &&\n \n \t\tgit init --bare bad-tag &&\n-\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n+\t\tbad_tag=$(git -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig)\n \t'\n \n \ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n@@ -75,6 +75,16 @@ check_verify_failure () {\n \t\t# will always fail.\n \t\ttest_must_fail git -C bad-tag fsck\n \t'\n+\n+\ttest_expect_success \"for-each-ref: $subject\" '\n+\t\techo \"$bad_tag\" >\"bad-tag/$tag_ref\" &&\n+\n+\t\tprintf \"%s tag\\t%s\\n\" \"$bad_tag\" \"$tag_ref\" >expected &&\n+\t\tgit -C bad-tag for-each-ref \"$tag_ref\" >actual &&\n+\t\ttest_cmp expected actual &&\n+\n+\t\ttest_must_fail git -C bad-tag for-each-ref --format=\"%(*objectname)\"\n+\t'\n }\n \n test_expect_mktag_success() {\n-- \n2.32.0.555.g0268d380f7b\n\n"},{"id":"427402","messageId":"xmqqczsnyggg.fsf@gitster.g","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"Re: [PATCH 0/6] mktag tests: test more exhaustively","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-06-15T03:06:23Z","receivedAt":"2021-06-15T03:06:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> ... But now that the dust has settled I figured I'd submit this\n> test-only series which stresses mktag, fsck and various commands that\n> might deal with the broken objects the mktag tests creates.\n\nThanks for not forgetting ;-)\n"},{"id":"427441","messageId":"6148debe-fc44-67b7-ac9c-f27d376bc9f2@gmail.com","threadId":"55929","inReplyTo":"patch-3.6-96520b3e89a-20210614T172422Z-avarab@gmail.com","subject":"Re: [PATCH 3/6] mktag tests: test hash-object --literally and unreachable fsck","fromName":"Andrei Rybak","fromEmail":"rybak.a.v@gmail.com","sentAt":"2021-06-15T10:34:09Z","receivedAt":"2021-06-15T10:34:17Z","isPatch":true,"sender":{"key":"rybak.a.v@gmail.com","avatar":"https://avatars.githubusercontent.com/u/624072?v=4"},"body":"On 14/06/2021 19:28, Ævar Arnfjörð Bjarmason wrote:\n> Extend the mktag tests to pass the tag we've created through both\n> hash-object --literally and fsck.\n> \n> This checks that fsck itself will not complain about certain invalid\n> content if a reachable tip isn't involved. Due to how fsck works and\n> walks the graph the failure will be different if the object is\n> reachable, so we might succeed before we've created the ref.\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>   t/t3800-mktag.sh | 48 +++++++++++++++++++++++++++++++++++++++---------\n>   1 file changed, 39 insertions(+), 9 deletions(-)\n> \n> diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\n> index 951e6d39c2a..43b67a149f8 100755\n> --- a/t/t3800-mktag.sh\n> +++ b/t/t3800-mktag.sh\n> @@ -16,6 +16,8 @@ check_verify_failure () {\n>   \tmessage=$2 &&\n>   \tshift 2 &&\n>   \n> +\tno_strict= &&\n> +\tfsck_obj_ok= &&\n>   \tno_strict= &&\n>   \twhile test $# != 0\n>   \tdo\n> @@ -23,7 +25,10 @@ check_verify_failure () {\n>   \t\t--no-strict)\n>   \t\t\tno_strict=yes\n>   \t\t\t;;\n> -\t\tesac &&\n> +\t\t--fsck-obj-ok)\n> +\t\t\tfsck_obj_ok=yes\n> +\t\t\t;;\n> +\t\tesac\n\n\"&&\" after \"esac\" got removed.\n\n>   \t\tshift\n>   \tdone &&\n>   \n> @@ -37,6 +42,23 @@ check_verify_failure () {\n>   \t\t\tgit mktag --no-strict <tag.sig\n>   \t\tfi\n>   \t'\n> +\n> +\ttest_expect_success \"setup: $subject\" '\n> +\t\t# Reset any leftover state from the last $subject\n> +\t\trm -rf bad-tag &&\n> +\n> +\t\tgit init --bare bad-tag &&\n> +\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n> +\t'\n> +\n> +\ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n> +\t\tif test -n \"$fsck_obj_ok\"\n> +\t\tthen\n> +\t\t\tgit -C bad-tag fsck\n> +\t\telse\n> +\t\t\ttest_must_fail git -C bad-tag fsck >out 2>err\n\nThis is the very end of the check_verify_failure function. It seems\nthat after \"out\" and \"err\" are created here, nothing else checks their\ncontents.\n\n> +\t\tfi\n> +\t'\n>   }\n>   \n>   test_expect_mktag_success() {\n> @@ -183,7 +205,8 @@ tagger . <> 0 +0000\n>   EOF\n>   \n>   check_verify_failure 'verify object (hash/type) check -- correct type, nonexisting object' \\\n> -\t'^fatal: could not read tagged object'\n> +\t'^fatal: could not read tagged object' \\\n> +\t--fsck-obj-ok\n>   \n>   cat >tag.sig <<EOF\n>   object $head\n> @@ -216,7 +239,8 @@ tagger . <> 0 +0000\n>   EOF\n>   \n>   check_verify_failure 'verify object (hash/type) check -- mismatched type, valid object' \\\n> -\t'^fatal: object.*tagged as.*tree.*but is.*commit'\n> +\t'^fatal: object.*tagged as.*tree.*but is.*commit' \\\n> +\t--fsck-obj-ok\n>   \n>   ############################################################\n>   #  9.5. verify object (hash/type) check -- replacement\n> @@ -245,7 +269,8 @@ tagger . <> 0 +0000\n>   EOF\n>   \n>   check_verify_failure 'verify object (hash/type) check -- mismatched type, valid object' \\\n> -\t'^fatal: object.*tagged as.*tree.*but is.*blob'\n> +\t'^fatal: object.*tagged as.*tree.*but is.*blob' \\\n> +\t--fsck-obj-ok\n>   \n>   ############################################################\n>   # 10. verify tag-name check\n> @@ -260,7 +285,8 @@ EOF\n>   \n>   check_verify_failure 'verify tag-name check' \\\n>   \t'^error:.* badTagName:' \\\n> -\t--no-strict\n> +\t--no-strict \\\n> +\t--fsck-obj-ok\n>   \n>   ############################################################\n>   # 11. tagger line label check #1\n> @@ -275,7 +301,8 @@ EOF\n>   \n>   check_verify_failure '\"tagger\" line label check #1' \\\n>   \t'^error:.* missingTaggerEntry:' \\\n> -\t--no-strict\n> +\t--no-strict \\\n> +\t--fsck-obj-ok\n>   \n>   ############################################################\n>   # 12. tagger line label check #2\n> @@ -291,7 +318,8 @@ EOF\n>   \n>   check_verify_failure '\"tagger\" line label check #2' \\\n>   \t'^error:.* missingTaggerEntry:' \\\n> -\t--no-strict\n> +\t--no-strict \\\n> +\t--fsck-obj-ok\n>   \n>   ############################################################\n>   # 13. allow missing tag author name like fsck\n> @@ -321,7 +349,8 @@ EOF\n>   \n>   check_verify_failure 'disallow malformed tagger' \\\n>   \t'^error:.* badEmail:' \\\n> -\t--no-strict\n> +\t--no-strict \\\n> +\t--fsck-obj-ok\n>   \n>   ############################################################\n>   # 15. allow empty tag email\n> @@ -446,7 +475,8 @@ EOF\n>   \n>   check_verify_failure 'detect invalid header entry' \\\n>   \t'^error:.* extraHeaderEntry:' \\\n> -\t--no-strict\n> +\t--no-strict \\\n> +\t--fsck-obj-ok\n>   \n>   test_expect_success 'invalid header entry config & fsck' '\n>   \ttest_must_fail git mktag <tag.sig &&\n> \n\n"},{"id":"427480","messageId":"87czsnyyt8.fsf@evledraar.gmail.com","threadId":"55929","inReplyTo":"6148debe-fc44-67b7-ac9c-f27d376bc9f2@gmail.com","subject":"Re: [PATCH 3/6] mktag tests: test hash-object --literally and unreachable fsck","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-15T14:41:36Z","receivedAt":"2021-06-15T14:42:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Jun 15 2021, Andrei Rybak wrote:\n\n> On 14/06/2021 19:28, Ævar Arnfjörð Bjarmason wrote:\n>> Extend the mktag tests to pass the tag we've created through both\n>> hash-object --literally and fsck.\n>> This checks that fsck itself will not complain about certain invalid\n>> content if a reachable tip isn't involved. Due to how fsck works and\n>> walks the graph the failure will be different if the object is\n>> reachable, so we might succeed before we've created the ref.\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> ---\n>>   t/t3800-mktag.sh | 48 +++++++++++++++++++++++++++++++++++++++---------\n>>   1 file changed, 39 insertions(+), 9 deletions(-)\n>> diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\n>> index 951e6d39c2a..43b67a149f8 100755\n>> --- a/t/t3800-mktag.sh\n>> +++ b/t/t3800-mktag.sh\n>> @@ -16,6 +16,8 @@ check_verify_failure () {\n>>   \tmessage=$2 &&\n>>   \tshift 2 &&\n>>   +\tno_strict= &&\n>> +\tfsck_obj_ok= &&\n>>   \tno_strict= &&\n>>   \twhile test $# != 0\n>>   \tdo\n>> @@ -23,7 +25,10 @@ check_verify_failure () {\n>>   \t\t--no-strict)\n>>   \t\t\tno_strict=yes\n>>   \t\t\t;;\n>> -\t\tesac &&\n>> +\t\t--fsck-obj-ok)\n>> +\t\t\tfsck_obj_ok=yes\n>> +\t\t\t;;\n>> +\t\tesac\n>\n> \"&&\" after \"esac\" got removed.\n\nThanks, will fix.\n\n>>   \t\tshift\n>>   \tdone &&\n>>   @@ -37,6 +42,23 @@ check_verify_failure () {\n>>   \t\t\tgit mktag --no-strict <tag.sig\n>>   \t\tfi\n>>   \t'\n>> +\n>> +\ttest_expect_success \"setup: $subject\" '\n>> +\t\t# Reset any leftover state from the last $subject\n>> +\t\trm -rf bad-tag &&\n>> +\n>> +\t\tgit init --bare bad-tag &&\n>> +\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n>> +\t'\n>> +\n>> +\ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n>> +\t\tif test -n \"$fsck_obj_ok\"\n>> +\t\tthen\n>> +\t\t\tgit -C bad-tag fsck\n>> +\t\telse\n>> +\t\t\ttest_must_fail git -C bad-tag fsck >out 2>err\n>\n> This is the very end of the check_verify_failure function. It seems\n> that after \"out\" and \"err\" are created here, nothing else checks their\n> contents.\n\nWell spotted, will fix this and any other such needless rederiction in a\nv2 I'll send after any other reviewing quiets down.\n"},{"id":"427721","messageId":"cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com","subject":"[PATCH v2 0/6] mktag tests: test more exhaustively","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:41:56Z","receivedAt":"2021-06-17T10:42:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"A re-roll of [1] which adds more mktag tests. Fixes the issues noted\nin [2] and one more that I spotted myself: I used a \"$bad_tag\" in an\nearlier commit than it was defined. I've fixed that, and changed the\nstructure of the tests (use rev-parse to assert) to make sure it is\ndefined before we do the \"test_must_fail\" tests.\n\n1. https://lore.kernel.org/git/cover-0.6-00000000000-20210614T172422Z-avarab@gmail.com\n2. https://lore.kernel.org/git/6148debe-fc44-67b7-ac9c-f27d376bc9f2@gmail.com\n\nÆvar Arnfjörð Bjarmason (6):\n  mktag tests: parse out options in helper\n  mktag tests: invert --no-strict test\n  mktag tests: test hash-object --literally and unreachable fsck\n  mktag tests: test update-ref and reachable fsck\n  mktag tests: test for-each-ref\n  mktag tests: test fast-export\n\n t/t3800-mktag.sh | 121 +++++++++++++++++++++++++++++++++++++++++------\n 1 file changed, 106 insertions(+), 15 deletions(-)\n\nRange-diff against v1:\n1:  d49549973d = 1:  d49549973d mktag tests: parse out options in helper\n2:  550dcedfcb = 2:  550dcedfcb mktag tests: invert --no-strict test\n3:  96520b3e89 ! 3:  bab235d752 mktag tests: test hash-object --literally and unreachable fsck\n    @@ t/t3800-mktag.sh: check_verify_failure () {\n      \t\t--no-strict)\n      \t\t\tno_strict=yes\n      \t\t\t;;\n    --\t\tesac &&\n     +\t\t--fsck-obj-ok)\n     +\t\t\tfsck_obj_ok=yes\n     +\t\t\t;;\n    -+\t\tesac\n    + \t\tesac &&\n      \t\tshift\n      \tdone &&\n    - \n     @@ t/t3800-mktag.sh: check_verify_failure () {\n      \t\t\tgit mktag --no-strict <tag.sig\n      \t\tfi\n    @@ t/t3800-mktag.sh: check_verify_failure () {\n     +\t\tthen\n     +\t\t\tgit -C bad-tag fsck\n     +\t\telse\n    -+\t\t\ttest_must_fail git -C bad-tag fsck >out 2>err\n    ++\t\t\ttest_must_fail git -C bad-tag fsck\n     +\t\tfi\n     +\t'\n      }\n4:  0359becdc9 ! 4:  a1d95c81ea mktag tests: test update-ref and reachable fsck\n    @@ t/t3800-mktag.sh: check_verify_failure () {\n      \t\t# Reset any leftover state from the last $subject\n      \t\trm -rf bad-tag &&\n      \n    + \t\tgit init --bare bad-tag &&\n    +-\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n    ++\t\tbad_tag=$(git -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig)\n    + \t'\n    + \n    + \ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n     @@ t/t3800-mktag.sh: check_verify_failure () {\n    - \t\t\ttest_must_fail git -C bad-tag fsck >out 2>err\n    + \t\t\ttest_must_fail git -C bad-tag fsck\n      \t\tfi\n      \t'\n     +\n     +\ttest_expect_success \"update-ref & fsck reachable: $subject\" '\n    ++\t\t# Make sure the earlier test created it for us\n    ++\t\tgit rev-parse \"$bad_tag\" &&\n    ++\n     +\t\t# The update-ref of the bad content will fail, do it\n     +\t\t# anyway to see if it segfaults\n     +\t\ttest_might_fail git -C bad-tag update-ref \"$tag_ref\" \"$bad_tag\" &&\n5:  8a626fc63a ! 5:  f4c41be92d mktag tests: test for-each-ref\n    @@ Commit message\n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n      ## t/t3800-mktag.sh ##\n    -@@ t/t3800-mktag.sh: check_verify_failure () {\n    - \t\trm -rf bad-tag &&\n    - \n    - \t\tgit init --bare bad-tag &&\n    --\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n    -+\t\tbad_tag=$(git -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig)\n    - \t'\n    - \n    - \ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n     @@ t/t3800-mktag.sh: check_verify_failure () {\n      \t\t# will always fail.\n      \t\ttest_must_fail git -C bad-tag fsck\n      \t'\n     +\n     +\ttest_expect_success \"for-each-ref: $subject\" '\n    ++\t\t# Make sure the earlier test created it for us\n    ++\t\tgit rev-parse \"$bad_tag\" &&\n    ++\n     +\t\techo \"$bad_tag\" >\"bad-tag/$tag_ref\" &&\n     +\n     +\t\tprintf \"%s tag\\t%s\\n\" \"$bad_tag\" \"$tag_ref\" >expected &&\n6:  6d613d88ac ! 6:  797c8d3a87 mktag tests: test fast-export\n    @@ t/t3800-mktag.sh: check_verify_failure () {\n      \t'\n     +\n     +\ttest_expect_success \"fast-export & fast-import: $subject\" '\n    ++\t\t# Make sure the earlier test created it for us\n    ++\t\tgit rev-parse \"$bad_tag\" &&\n    ++\n     +\t\ttest_must_fail git -C bad-tag fast-export --all &&\n    -+\t\ttest_must_fail git -C bad-tag fast-export $bad_tag\n    ++\t\ttest_must_fail git -C bad-tag fast-export \"$bad_tag\"\n     +\t'\n      }\n      \n-- \n2.32.0.571.gdba276db2c\n\n"},{"id":"427722","messageId":"patch-1.6-d49549973d-20210617T104011Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com","subject":"[PATCH v2 1/6] mktag tests: parse out options in helper","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:41:57Z","receivedAt":"2021-06-17T10:42:11Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change check_verify_failure() helper to parse out options from\n$@. This makes it easier to add new options in the future. See\n06ce79152be (mktag: add a --[no-]strict option, 2021-01-06) for the\ninitial implementation.\n\nLet's also replace \"\" quotes with '' for the test body, the varables\nwe need are eval'd into the body, so there's no need for the quoting\nconfusion.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 43 +++++++++++++++++++++++++++++++------------\n 1 file changed, 31 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 6275c98523..e9008744e3 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -12,15 +12,29 @@ test_description='git mktag: tag object verify test'\n # given in the expect.pat file.\n \n check_verify_failure () {\n-\ttest_expect_success \"$1\" \"\n-\t\ttest_must_fail git mktag <tag.sig 2>message &&\n-\t\tgrep '$2' message &&\n-\t\tif test '$3' != '--no-strict'\n+\tsubject=$1 &&\n+\tmessage=$2 &&\n+\tshift 2 &&\n+\n+\tno_strict= &&\n+\twhile test $# != 0\n+\tdo\n+\t\tcase \"$1\" in\n+\t\t--no-strict)\n+\t\t\tno_strict=yes\n+\t\t\t;;\n+\t\tesac &&\n+\t\tshift\n+\tdone &&\n+\n+\ttest_expect_success \"fail with [--[no-]strict]: $subject\" '\n+\t\ttest_must_fail git mktag <tag.sig 2>err &&\n+\t\tif test -z \"$no_strict\"\n \t\tthen\n-\t\t\ttest_must_fail git mktag --no-strict <tag.sig 2>message.no-strict &&\n-\t\t\tgrep '$2' message.no-strict\n+\t\t\ttest_must_fail git mktag <tag.sig 2>err2 &&\n+\t\t\ttest_cmp err err2\n \t\tfi\n-\t\"\n+\t'\n }\n \n test_expect_mktag_success() {\n@@ -243,7 +257,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify tag-name check' \\\n-\t'^error:.* badTagName:' '--no-strict'\n+\t'^error:.* badTagName:' \\\n+\t--no-strict\n \n ############################################################\n # 11. tagger line label check #1\n@@ -257,7 +272,8 @@ This is filler\n EOF\n \n check_verify_failure '\"tagger\" line label check #1' \\\n-\t'^error:.* missingTaggerEntry:' '--no-strict'\n+\t'^error:.* missingTaggerEntry:' \\\n+\t--no-strict\n \n ############################################################\n # 12. tagger line label check #2\n@@ -272,7 +288,8 @@ This is filler\n EOF\n \n check_verify_failure '\"tagger\" line label check #2' \\\n-\t'^error:.* missingTaggerEntry:' '--no-strict'\n+\t'^error:.* missingTaggerEntry:' \\\n+\t--no-strict\n \n ############################################################\n # 13. allow missing tag author name like fsck\n@@ -301,7 +318,8 @@ tagger T A Gger <\n EOF\n \n check_verify_failure 'disallow malformed tagger' \\\n-\t'^error:.* badEmail:' '--no-strict'\n+\t'^error:.* badEmail:' \\\n+\t--no-strict\n \n ############################################################\n # 15. allow empty tag email\n@@ -425,7 +443,8 @@ this line should not be here\n EOF\n \n check_verify_failure 'detect invalid header entry' \\\n-\t'^error:.* extraHeaderEntry:' '--no-strict'\n+\t'^error:.* extraHeaderEntry:' \\\n+\t--no-strict\n \n test_expect_success 'invalid header entry config & fsck' '\n \ttest_must_fail git mktag <tag.sig &&\n-- \n2.32.0.571.gdba276db2c\n\n"},{"id":"427723","messageId":"patch-2.6-550dcedfcb-20210617T104011Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com","subject":"[PATCH v2 2/6] mktag tests: invert --no-strict test","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:41:58Z","receivedAt":"2021-06-17T10:42:11Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the mktag --no-strict test to actually test success under\n--no-strict, that test was added in 06ce79152be (mktag: add a\n--[no-]strict option, 2021-01-06).\n\nIt doesn't make sense to check that we have the same failure except\nwhen we want --no-strict, by doing that we're assuming that the\nbehavior will be different under --no-strict, bun nothing was testing\nfor that.\n\nWe should instead assert that --strict is the same as --no-strict,\nexcept in the cases where we've declared that it's not.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex e9008744e3..951e6d39c2 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -33,6 +33,8 @@ check_verify_failure () {\n \t\tthen\n \t\t\ttest_must_fail git mktag <tag.sig 2>err2 &&\n \t\t\ttest_cmp err err2\n+\t\telse\n+\t\t\tgit mktag --no-strict <tag.sig\n \t\tfi\n \t'\n }\n-- \n2.32.0.571.gdba276db2c\n\n"},{"id":"427724","messageId":"patch-3.6-bab235d752-20210617T104011Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com","subject":"[PATCH v2 3/6] mktag tests: test hash-object --literally and unreachable fsck","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:41:59Z","receivedAt":"2021-06-17T10:42:12Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Extend the mktag tests to pass the tag we've created through both\nhash-object --literally and fsck.\n\nThis checks that fsck itself will not complain about certain invalid\ncontent if a reachable tip isn't involved. Due to how fsck works and\nwalks the graph the failure will be different if the object is\nreachable, so we might succeed before we've created the ref.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 46 ++++++++++++++++++++++++++++++++++++++--------\n 1 file changed, 38 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 951e6d39c2..78c6f64e36 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -16,6 +16,8 @@ check_verify_failure () {\n \tmessage=$2 &&\n \tshift 2 &&\n \n+\tno_strict= &&\n+\tfsck_obj_ok= &&\n \tno_strict= &&\n \twhile test $# != 0\n \tdo\n@@ -23,6 +25,9 @@ check_verify_failure () {\n \t\t--no-strict)\n \t\t\tno_strict=yes\n \t\t\t;;\n+\t\t--fsck-obj-ok)\n+\t\t\tfsck_obj_ok=yes\n+\t\t\t;;\n \t\tesac &&\n \t\tshift\n \tdone &&\n@@ -37,6 +42,23 @@ check_verify_failure () {\n \t\t\tgit mktag --no-strict <tag.sig\n \t\tfi\n \t'\n+\n+\ttest_expect_success \"setup: $subject\" '\n+\t\t# Reset any leftover state from the last $subject\n+\t\trm -rf bad-tag &&\n+\n+\t\tgit init --bare bad-tag &&\n+\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n+\t'\n+\n+\ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n+\t\tif test -n \"$fsck_obj_ok\"\n+\t\tthen\n+\t\t\tgit -C bad-tag fsck\n+\t\telse\n+\t\t\ttest_must_fail git -C bad-tag fsck\n+\t\tfi\n+\t'\n }\n \n test_expect_mktag_success() {\n@@ -183,7 +205,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify object (hash/type) check -- correct type, nonexisting object' \\\n-\t'^fatal: could not read tagged object'\n+\t'^fatal: could not read tagged object' \\\n+\t--fsck-obj-ok\n \n cat >tag.sig <<EOF\n object $head\n@@ -216,7 +239,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify object (hash/type) check -- mismatched type, valid object' \\\n-\t'^fatal: object.*tagged as.*tree.*but is.*commit'\n+\t'^fatal: object.*tagged as.*tree.*but is.*commit' \\\n+\t--fsck-obj-ok\n \n ############################################################\n #  9.5. verify object (hash/type) check -- replacement\n@@ -245,7 +269,8 @@ tagger . <> 0 +0000\n EOF\n \n check_verify_failure 'verify object (hash/type) check -- mismatched type, valid object' \\\n-\t'^fatal: object.*tagged as.*tree.*but is.*blob'\n+\t'^fatal: object.*tagged as.*tree.*but is.*blob' \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 10. verify tag-name check\n@@ -260,7 +285,8 @@ EOF\n \n check_verify_failure 'verify tag-name check' \\\n \t'^error:.* badTagName:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 11. tagger line label check #1\n@@ -275,7 +301,8 @@ EOF\n \n check_verify_failure '\"tagger\" line label check #1' \\\n \t'^error:.* missingTaggerEntry:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 12. tagger line label check #2\n@@ -291,7 +318,8 @@ EOF\n \n check_verify_failure '\"tagger\" line label check #2' \\\n \t'^error:.* missingTaggerEntry:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 13. allow missing tag author name like fsck\n@@ -321,7 +349,8 @@ EOF\n \n check_verify_failure 'disallow malformed tagger' \\\n \t'^error:.* badEmail:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n ############################################################\n # 15. allow empty tag email\n@@ -446,7 +475,8 @@ EOF\n \n check_verify_failure 'detect invalid header entry' \\\n \t'^error:.* extraHeaderEntry:' \\\n-\t--no-strict\n+\t--no-strict \\\n+\t--fsck-obj-ok\n \n test_expect_success 'invalid header entry config & fsck' '\n \ttest_must_fail git mktag <tag.sig &&\n-- \n2.32.0.571.gdba276db2c\n\n"},{"id":"427725","messageId":"patch-5.6-f4c41be92d-20210617T104011Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com","subject":"[PATCH v2 5/6] mktag tests: test for-each-ref","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:42:01Z","receivedAt":"2021-06-17T10:42:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a \"for-each-ref\" for all the mktag tests. This test would have\ncaught the segfault which was fixed in c6854508808 (ref-filter: fix\nNULL check for parse object failure, 2021-04-01). Let's make sure we\ntest that code more exhaustively.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 67f6ecbe88..bb71303399 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -78,6 +78,19 @@ check_verify_failure () {\n \t\t# will always fail.\n \t\ttest_must_fail git -C bad-tag fsck\n \t'\n+\n+\ttest_expect_success \"for-each-ref: $subject\" '\n+\t\t# Make sure the earlier test created it for us\n+\t\tgit rev-parse \"$bad_tag\" &&\n+\n+\t\techo \"$bad_tag\" >\"bad-tag/$tag_ref\" &&\n+\n+\t\tprintf \"%s tag\\t%s\\n\" \"$bad_tag\" \"$tag_ref\" >expected &&\n+\t\tgit -C bad-tag for-each-ref \"$tag_ref\" >actual &&\n+\t\ttest_cmp expected actual &&\n+\n+\t\ttest_must_fail git -C bad-tag for-each-ref --format=\"%(*objectname)\"\n+\t'\n }\n \n test_expect_mktag_success() {\n-- \n2.32.0.571.gdba276db2c\n\n"},{"id":"427726","messageId":"patch-4.6-a1d95c81ea-20210617T104011Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com","subject":"[PATCH v2 4/6] mktag tests: test update-ref and reachable fsck","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:42:00Z","receivedAt":"2021-06-17T10:42:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Extend the mktag tests to pass the created bad tag through update-ref\nand fsck.\n\nThe reason for passing it through update-ref is to guard against it\nhaving a segfault as for-each-ref did before c6854508808 (ref-filter:\nfix NULL check for parse object failure, 2021-04-01).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex 78c6f64e36..67f6ecbe88 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -44,11 +44,13 @@ check_verify_failure () {\n \t'\n \n \ttest_expect_success \"setup: $subject\" '\n+\t\ttag_ref=refs/tags/bad_tag &&\n+\n \t\t# Reset any leftover state from the last $subject\n \t\trm -rf bad-tag &&\n \n \t\tgit init --bare bad-tag &&\n-\t\tgit -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig\n+\t\tbad_tag=$(git -C bad-tag hash-object -t tag -w --stdin --literally <tag.sig)\n \t'\n \n \ttest_expect_success \"hash-object & fsck unreachable: $subject\" '\n@@ -59,6 +61,23 @@ check_verify_failure () {\n \t\t\ttest_must_fail git -C bad-tag fsck\n \t\tfi\n \t'\n+\n+\ttest_expect_success \"update-ref & fsck reachable: $subject\" '\n+\t\t# Make sure the earlier test created it for us\n+\t\tgit rev-parse \"$bad_tag\" &&\n+\n+\t\t# The update-ref of the bad content will fail, do it\n+\t\t# anyway to see if it segfaults\n+\t\ttest_might_fail git -C bad-tag update-ref \"$tag_ref\" \"$bad_tag\" &&\n+\n+\t\t# Manually create the broken, we cannot do it with\n+\t\t# update-ref\n+\t\techo \"$bad_tag\" >\"bad-tag/$tag_ref\" &&\n+\n+\t\t# Unlike fsck-ing unreachable content above, this\n+\t\t# will always fail.\n+\t\ttest_must_fail git -C bad-tag fsck\n+\t'\n }\n \n test_expect_mktag_success() {\n-- \n2.32.0.571.gdba276db2c\n\n"},{"id":"427727","messageId":"patch-6.6-797c8d3a87-20210617T104011Z-avarab@gmail.com","threadId":"55929","inReplyTo":"cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com","subject":"[PATCH v2 6/6] mktag tests: test fast-export","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:42:02Z","receivedAt":"2021-06-17T10:42:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Pass the bad tags we've created in the mktag tests through\nfast-export, it will die on the bad object or ref, let's make sure\nthat happens.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3800-mktag.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh\nindex bb71303399..0544d58a6e 100755\n--- a/t/t3800-mktag.sh\n+++ b/t/t3800-mktag.sh\n@@ -91,6 +91,14 @@ check_verify_failure () {\n \n \t\ttest_must_fail git -C bad-tag for-each-ref --format=\"%(*objectname)\"\n \t'\n+\n+\ttest_expect_success \"fast-export & fast-import: $subject\" '\n+\t\t# Make sure the earlier test created it for us\n+\t\tgit rev-parse \"$bad_tag\" &&\n+\n+\t\ttest_must_fail git -C bad-tag fast-export --all &&\n+\t\ttest_must_fail git -C bad-tag fast-export \"$bad_tag\"\n+\t'\n }\n \n test_expect_mktag_success() {\n-- \n2.32.0.571.gdba276db2c\n\n"}]}