{"thread":{"id":"66488","subject":"[PATCH] t7004: check a missing key without deleting gpghome","startedAt":"2026-10-08T09:07:45Z","lastAt":"2026-10-08T19:40:43Z","messageCount":2,"participants":["Harald Nordgren via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"554460","messageId":"pull.2443.git.git.1791450465178.gitgitgadget@gmail.com","threadId":"66488","inReplyTo":null,"subject":"[PATCH] t7004: check a missing key without deleting gpghome","fromName":"Harald Nordgren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-08T09:07:45Z","receivedAt":"2026-10-08T09:07:45Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"From: Harald Nordgren <haraldnordgren@gmail.com>\n\nThe \"verify signed tag fails when public key is not present\" test\ndeletes gpghome to lose the key, and this sometimes fails on Alpine\nwith\n\n    rm: can't remove 'gpghome/S.gpg-agent.extra': No such file or directory\n\nPoint GNUPGHOME at an unused directory for the verification, which is\nhow t7510 checks a signature whose key is unknown.\n\nSigned-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n---\n    t7004: check a missing key without deleting gpghome\n    \n    Fix flaky test by checking missing key without deleting gpghome.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2443%2FHaraldNordgren%2Fflaky-gpg-http2-tests-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2443/HaraldNordgren/flaky-gpg-http2-tests-v1\nPull-Request: https://github.com/git/git/pull/2443\n\n t/t7004-tag.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 8c795d7218..a0c2c9a3a1 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -11,6 +11,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./test-lib.sh\n+GNUPGHOME_NOT_USED=$GNUPGHOME\n . \"$TEST_DIRECTORY\"/lib-gpg.sh\n . \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n@@ -1525,8 +1526,7 @@ test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signa\n # try to verify without gpg:\n \n test_expect_success GPG 'verify signed tag fails when public key is not present' '\n-\trm -rf gpghome &&\n-\ttest_must_fail git tag -v signed-tag\n+\ttest_must_fail env GNUPGHOME=\"$GNUPGHOME_NOT_USED\" git tag -v signed-tag\n '\n \n test_expect_success 'git tag -a fails if tag annotation is empty' '\n\nbase-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\n-- \ngitgitgadget\n\n"},{"id":"554532","messageId":"xmqqpkxkyo90.fsf@gitster.g","threadId":"66488","inReplyTo":"pull.2443.git.git.1791450465178.gitgitgadget@gmail.com","subject":"Re: [PATCH] t7004: check a missing key without deleting gpghome","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-08T19:40:43Z","receivedAt":"2026-10-08T19:40:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Harald Nordgren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Harald Nordgren <haraldnordgren@gmail.com>\n>\n> The \"verify signed tag fails when public key is not present\" test\n> deletes gpghome to lose the key, and this sometimes fails on Alpine\n> with\n>\n>     rm: can't remove 'gpghome/S.gpg-agent.extra': No such file or directory\n>\n> Point GNUPGHOME at an unused directory for the verification, which is\n> how t7510 checks a signature whose key is unknown.\n>\n> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n> ---\n\nInteresting.  It is curious why removal \"sometimes\" fails but it\nis coming from clean-up the gpg-agent tries to do, probably.\n\nIn any case, it is a very good idea to borrow solution from an\nexisting test.  Nicely done.\n\nWill queue.  Thanks.\n\n>     t7004: check a missing key without deleting gpghome\n>     \n>     Fix flaky test by checking missing key without deleting gpghome.\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2443%2FHaraldNordgren%2Fflaky-gpg-http2-tests-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2443/HaraldNordgren/flaky-gpg-http2-tests-v1\n> Pull-Request: https://github.com/git/git/pull/2443\n>\n>  t/t7004-tag.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\n> index 8c795d7218..a0c2c9a3a1 100755\n> --- a/t/t7004-tag.sh\n> +++ b/t/t7004-tag.sh\n> @@ -11,6 +11,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>  \n>  . ./test-lib.sh\n> +GNUPGHOME_NOT_USED=$GNUPGHOME\n>  . \"$TEST_DIRECTORY\"/lib-gpg.sh\n>  . \"$TEST_DIRECTORY\"/lib-terminal.sh\n>  \n> @@ -1525,8 +1526,7 @@ test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signa\n>  # try to verify without gpg:\n>  \n>  test_expect_success GPG 'verify signed tag fails when public key is not present' '\n> -\trm -rf gpghome &&\n> -\ttest_must_fail git tag -v signed-tag\n> +\ttest_must_fail env GNUPGHOME=\"$GNUPGHOME_NOT_USED\" git tag -v signed-tag\n>  '\n>  \n>  test_expect_success 'git tag -a fails if tag annotation is empty' '\n>\n> base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\n\n"}]}