{"thread":{"id":"37781","subject":"[RFD/PATCH] push: heed user.signingkey for signed pushes","startedAt":"2014-10-22T14:47:03Z","lastAt":"2014-10-24T16:49:34Z","messageCount":9,"participants":["Michael J Gruber","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"250963","messageId":"787502533676138ad113e446eba71d92dee3b4de.1413989046.git.git@drmicha.warpmail.net","threadId":"37781","inReplyTo":null,"subject":"[RFD/PATCH] push: heed user.signingkey for signed pushes","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-10-22T14:47:03Z","receivedAt":"2014-10-22T14:47:03Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"push --signed promises to take user.signingkey as the signing key but\nfails to read the config.\n\nMake it do so.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nInterestingly, when I wrote the test I had the impression that user.email\nis not heeded either - or do we have GIT_COMMITTER_EMAIL in the environment\nof the tests by default?\n\nIn any case, that is why the test looks the way it looks and why this is RFD.\n\n 1 file changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex ae56f73..a076b19 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -471,6 +471,17 @@ static int option_parse_recurse_submodules(const struct option *opt,\n \treturn 0;\n }\n \n+static int git_push_config(const char *k, const char *v, void *cb)\n+{\n+\tstruct wt_status *s = cb;\n+\tint status;\n+\n+\tstatus = git_gpg_config(k, v, NULL);\n+\tif (status)\n+\t\treturn status;\n+\treturn git_default_config(k, v, s);\n+}\n+\n int cmd_push(int argc, const char **argv, const char *prefix)\n {\n \tint flags = 0;\n@@ -511,7 +522,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \t};\n \n \tpacket_trace_identity(\"push\");\n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_push_config, NULL);\n \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n \n \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\n-- \n2.1.2.756.gfa53a0a\n\n\n builtin/push.c         |  13 ++++++++++++-\n t/lib-gpg/trustdb.gpg  | Bin 1360 -> 1360 bytes\n t/t5534-push-signed.sh |  43 +++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 55 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex ae56f73..a076b19 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -471,6 +471,17 @@ static int option_parse_recurse_submodules(const struct option *opt,\n \treturn 0;\n }\n \n+static int git_push_config(const char *k, const char *v, void *cb)\n+{\n+\tstruct wt_status *s = cb;\n+\tint status;\n+\n+\tstatus = git_gpg_config(k, v, NULL);\n+\tif (status)\n+\t\treturn status;\n+\treturn git_default_config(k, v, s);\n+}\n+\n int cmd_push(int argc, const char **argv, const char *prefix)\n {\n \tint flags = 0;\n@@ -511,7 +522,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \t};\n \n \tpacket_trace_identity(\"push\");\n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_push_config, NULL);\n \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n \n \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\ndiff --git a/t/lib-gpg/trustdb.gpg b/t/lib-gpg/trustdb.gpg\nindex 4879ae9a84650a93a4d15bd6560c5d1b89eb4c2f..c11b1464b3d13b45966a493e2174fc0e253ddd0c 100644\nGIT binary patch\ndelta 47\nncmcb>b%9HOF})z2nVFH5k%@sJ#C^}~iH71E)x}wb7%%_;=xPS!\n\ndelta 51\ntcmcb>b%9HSF})z2nVFH5k%@sJ&}Z5*1_lPkiGso#)x}wb*nk{V008$D2C@JE\n\ndiff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh\nindex 2786346..c68867d 100755\n--- a/t/t5534-push-signed.sh\n+++ b/t/t5534-push-signed.sh\n@@ -124,4 +124,47 @@ test_expect_success GPG 'signed push sends push certificate' '\n \ttest_cmp expect dst/push-cert-status\n '\n \n+test_expect_success GPG 'fail without key and heed user.signingkey' '\n+\tprepare_dst &&\n+\tmkdir -p dst/.git/hooks &&\n+\tgit -C dst config receive.certnonceseed sekrit &&\n+\twrite_script dst/.git/hooks/post-receive <<-\\EOF &&\n+\t# discard the update list\n+\tcat >/dev/null\n+\t# record the push certificate\n+\tif test -n \"${GIT_PUSH_CERT-}\"\n+\tthen\n+\t\tgit cat-file blob $GIT_PUSH_CERT >../push-cert\n+\tfi &&\n+\n+\tcat >../push-cert-status <<E_O_F\n+\tSIGNER=${GIT_PUSH_CERT_SIGNER-nobody}\n+\tKEY=${GIT_PUSH_CERT_KEY-nokey}\n+\tSTATUS=${GIT_PUSH_CERT_STATUS-nostatus}\n+\tNONCE_STATUS=${GIT_PUSH_CERT_NONCE_STATUS-nononcestatus}\n+\tNONCE=${GIT_PUSH_CERT_NONCE-nononce}\n+\tE_O_F\n+\n+\tEOF\n+\n+\tgit config user.email hasnokey@nowhere.com &&\n+\ttest_must_fail env GIT_COMMITTER_EMAIL=hasnokey@nowhere.com git push --signed dst noop ff +noff &&\n+\tgit config user.signingkey committer@example.com &&\n+\tGIT_COMMITTER_EMAIL=hasnokey@nowhere.com git push --signed dst noop ff +noff &&\n+\n+\t(\n+\t\tcat <<-\\EOF &&\n+\t\tSIGNER=C O Mitter <committer@example.com>\n+\t\tKEY=13B6F51ECDDE430D\n+\t\tSTATUS=G\n+\t\tNONCE_STATUS=OK\n+\t\tEOF\n+\t\tsed -n -e \"s/^nonce /NONCE=/p\" -e \"/^$/q\" dst/push-cert\n+\t) >expect &&\n+\n+\tgrep \"$(git rev-parse noop ff) refs/heads/ff\" dst/push-cert &&\n+\tgrep \"$(git rev-parse noop noff) refs/heads/noff\" dst/push-cert &&\n+\ttest_cmp expect dst/push-cert-status\n+'\n+\n test_done\n-- \n2.1.2.756.gfa53a0a\n"},{"id":"250964","messageId":"7b3546cd125d1ad92dd62297ecbe624a78c6079b.1413989799.git.git@drmicha.warpmail.net","threadId":"37781","inReplyTo":"787502533676138ad113e446eba71d92dee3b4de.1413989046.git.git@drmicha.warpmail.net","subject":"[PATCHv2] push: heed user.signingkey for signed pushes","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-10-22T14:57:49Z","receivedAt":"2014-10-22T14:57:49Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"push --signed promises to take user.signingkey as the signing key but\nfails to read the config.\n\nMake it do so.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nOkay, I guess this is nicer. We do have the committer info in the env. Sorry.\n\n builtin/push.c         |  13 ++++++++++++-\n t/lib-gpg/trustdb.gpg  | Bin 1360 -> 1360 bytes\n t/t5534-push-signed.sh |  44 ++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 56 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex ae56f73..a076b19 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -471,6 +471,17 @@ static int option_parse_recurse_submodules(const struct option *opt,\n \treturn 0;\n }\n \n+static int git_push_config(const char *k, const char *v, void *cb)\n+{\n+\tstruct wt_status *s = cb;\n+\tint status;\n+\n+\tstatus = git_gpg_config(k, v, NULL);\n+\tif (status)\n+\t\treturn status;\n+\treturn git_default_config(k, v, s);\n+}\n+\n int cmd_push(int argc, const char **argv, const char *prefix)\n {\n \tint flags = 0;\n@@ -511,7 +522,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \t};\n \n \tpacket_trace_identity(\"push\");\n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_push_config, NULL);\n \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n \n \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\ndiff --git a/t/lib-gpg/trustdb.gpg b/t/lib-gpg/trustdb.gpg\nindex 4879ae9a84650a93a4d15bd6560c5d1b89eb4c2f..c11b1464b3d13b45966a493e2174fc0e253ddd0c 100644\nGIT binary patch\ndelta 47\nncmcb>b%9HOF})z2nVFH5k%@sJ#C^}~iH71E)x}wb7%%_;=xPS!\n\ndelta 51\ntcmcb>b%9HSF})z2nVFH5k%@sJ&}Z5*1_lPkiGso#)x}wb*nk{V008$D2C@JE\n\ndiff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh\nindex 2786346..ecb8d44 100755\n--- a/t/t5534-push-signed.sh\n+++ b/t/t5534-push-signed.sh\n@@ -124,4 +124,48 @@ test_expect_success GPG 'signed push sends push certificate' '\n \ttest_cmp expect dst/push-cert-status\n '\n \n+test_expect_success GPG 'fail without key and heed user.signingkey' '\n+\tprepare_dst &&\n+\tmkdir -p dst/.git/hooks &&\n+\tgit -C dst config receive.certnonceseed sekrit &&\n+\twrite_script dst/.git/hooks/post-receive <<-\\EOF &&\n+\t# discard the update list\n+\tcat >/dev/null\n+\t# record the push certificate\n+\tif test -n \"${GIT_PUSH_CERT-}\"\n+\tthen\n+\t\tgit cat-file blob $GIT_PUSH_CERT >../push-cert\n+\tfi &&\n+\n+\tcat >../push-cert-status <<E_O_F\n+\tSIGNER=${GIT_PUSH_CERT_SIGNER-nobody}\n+\tKEY=${GIT_PUSH_CERT_KEY-nokey}\n+\tSTATUS=${GIT_PUSH_CERT_STATUS-nostatus}\n+\tNONCE_STATUS=${GIT_PUSH_CERT_NONCE_STATUS-nononcestatus}\n+\tNONCE=${GIT_PUSH_CERT_NONCE-nononce}\n+\tE_O_F\n+\n+\tEOF\n+\n+\tunset GIT_COMMITTER_EMAIL &&\n+\tgit config user.email hasnokey@nowhere.com &&\n+\ttest_must_fail git push --signed dst noop ff +noff &&\n+\tgit config user.signingkey committer@example.com &&\n+\tgit push --signed dst noop ff +noff &&\n+\n+\t(\n+\t\tcat <<-\\EOF &&\n+\t\tSIGNER=C O Mitter <committer@example.com>\n+\t\tKEY=13B6F51ECDDE430D\n+\t\tSTATUS=G\n+\t\tNONCE_STATUS=OK\n+\t\tEOF\n+\t\tsed -n -e \"s/^nonce /NONCE=/p\" -e \"/^$/q\" dst/push-cert\n+\t) >expect &&\n+\n+\tgrep \"$(git rev-parse noop ff) refs/heads/ff\" dst/push-cert &&\n+\tgrep \"$(git rev-parse noop noff) refs/heads/noff\" dst/push-cert &&\n+\ttest_cmp expect dst/push-cert-status\n+'\n+\n test_done\n-- \n2.1.2.756.gfa53a0a\n"},{"id":"250978","messageId":"xmqq7fzru5do.fsf@gitster.dls.corp.google.com","threadId":"37781","inReplyTo":"7b3546cd125d1ad92dd62297ecbe624a78c6079b.1413989799.git.git@drmicha.warpmail.net","subject":"Re: [PATCHv2] push: heed user.signingkey for signed pushes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-22T22:05:55Z","receivedAt":"2014-10-22T22:05:55Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> push --signed promises to take user.signingkey as the signing key but\n> fails to read the config.\n>\n> Make it do so.\n>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n> Okay, I guess this is nicer. We do have the committer info in the env. Sorry.\n>\n>  builtin/push.c         |  13 ++++++++++++-\n>  t/lib-gpg/trustdb.gpg  | Bin 1360 -> 1360 bytes\n>  t/t5534-push-signed.sh |  44 ++++++++++++++++++++++++++++++++++++++++++++\n>  3 files changed, 56 insertions(+), 1 deletion(-)\n\nHmph, I simply forgot about that configuration, I guess.\n\nWhat is this change to trustdb about, though?  The log message does\nnot say anything about it.\n\n>\n> diff --git a/builtin/push.c b/builtin/push.c\n> index ae56f73..a076b19 100644\n> --- a/builtin/push.c\n> +++ b/builtin/push.c\n> @@ -471,6 +471,17 @@ static int option_parse_recurse_submodules(const struct option *opt,\n>  \treturn 0;\n>  }\n>  \n> +static int git_push_config(const char *k, const char *v, void *cb)\n> +{\n> +\tstruct wt_status *s = cb;\n> +\tint status;\n> +\n> +\tstatus = git_gpg_config(k, v, NULL);\n> +\tif (status)\n> +\t\treturn status;\n> +\treturn git_default_config(k, v, s);\n> +}\n> +\n>  int cmd_push(int argc, const char **argv, const char *prefix)\n>  {\n>  \tint flags = 0;\n> @@ -511,7 +522,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n>  \t};\n>  \n>  \tpacket_trace_identity(\"push\");\n> -\tgit_config(git_default_config, NULL);\n> +\tgit_config(git_push_config, NULL);\n>  \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n>  \n>  \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\n> diff --git a/t/lib-gpg/trustdb.gpg b/t/lib-gpg/trustdb.gpg\n> index 4879ae9a84650a93a4d15bd6560c5d1b89eb4c2f..c11b1464b3d13b45966a493e2174fc0e253ddd0c 100644\n> GIT binary patch\n> delta 47\n> ncmcb>b%9HOF})z2nVFH5k%@sJ#C^}~iH71E)x}wb7%%_;=xPS!\n>\n> delta 51\n> tcmcb>b%9HSF})z2nVFH5k%@sJ&}Z5*1_lPkiGso#)x}wb*nk{V008$D2C@JE\n>\n> diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh\n> index 2786346..ecb8d44 100755\n> --- a/t/t5534-push-signed.sh\n> +++ b/t/t5534-push-signed.sh\n> @@ -124,4 +124,48 @@ test_expect_success GPG 'signed push sends push certificate' '\n>  \ttest_cmp expect dst/push-cert-status\n>  '\n>  \n> +test_expect_success GPG 'fail without key and heed user.signingkey' '\n> +\tprepare_dst &&\n> +\tmkdir -p dst/.git/hooks &&\n> +\tgit -C dst config receive.certnonceseed sekrit &&\n> +\twrite_script dst/.git/hooks/post-receive <<-\\EOF &&\n> +\t# discard the update list\n> +\tcat >/dev/null\n> +\t# record the push certificate\n> +\tif test -n \"${GIT_PUSH_CERT-}\"\n> +\tthen\n> +\t\tgit cat-file blob $GIT_PUSH_CERT >../push-cert\n> +\tfi &&\n> +\n> +\tcat >../push-cert-status <<E_O_F\n> +\tSIGNER=${GIT_PUSH_CERT_SIGNER-nobody}\n> +\tKEY=${GIT_PUSH_CERT_KEY-nokey}\n> +\tSTATUS=${GIT_PUSH_CERT_STATUS-nostatus}\n> +\tNONCE_STATUS=${GIT_PUSH_CERT_NONCE_STATUS-nononcestatus}\n> +\tNONCE=${GIT_PUSH_CERT_NONCE-nononce}\n> +\tE_O_F\n> +\n> +\tEOF\n> +\n> +\tunset GIT_COMMITTER_EMAIL &&\n> +\tgit config user.email hasnokey@nowhere.com &&\n> +\ttest_must_fail git push --signed dst noop ff +noff &&\n> +\tgit config user.signingkey committer@example.com &&\n> +\tgit push --signed dst noop ff +noff &&\n> +\n> +\t(\n> +\t\tcat <<-\\EOF &&\n> +\t\tSIGNER=C O Mitter <committer@example.com>\n> +\t\tKEY=13B6F51ECDDE430D\n> +\t\tSTATUS=G\n> +\t\tNONCE_STATUS=OK\n> +\t\tEOF\n> +\t\tsed -n -e \"s/^nonce /NONCE=/p\" -e \"/^$/q\" dst/push-cert\n> +\t) >expect &&\n> +\n> +\tgrep \"$(git rev-parse noop ff) refs/heads/ff\" dst/push-cert &&\n> +\tgrep \"$(git rev-parse noop noff) refs/heads/noff\" dst/push-cert &&\n> +\ttest_cmp expect dst/push-cert-status\n> +'\n> +\n>  test_done\n"},{"id":"250979","messageId":"xmqq38afu0of.fsf@gitster.dls.corp.google.com","threadId":"37781","inReplyTo":"xmqq7fzru5do.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCHv2] push: heed user.signingkey for signed pushes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-22T23:47:28Z","receivedAt":"2014-10-22T23:47:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n>\n>> push --signed promises to take user.signingkey as the signing key but\n>> fails to read the config.\n>>\n>> Make it do so.\n>>\n>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n>> ---\n>> Okay, I guess this is nicer. We do have the committer info in the env. Sorry.\n>>\n>>  builtin/push.c         |  13 ++++++++++++-\n>>  t/lib-gpg/trustdb.gpg  | Bin 1360 -> 1360 bytes\n>>  t/t5534-push-signed.sh |  44 ++++++++++++++++++++++++++++++++++++++++++++\n>>  3 files changed, 56 insertions(+), 1 deletion(-)\n>\n> Hmph, I simply forgot about that configuration, I guess.\n>\n> What is this change to trustdb about, though?  The log message does\n> not say anything about it.\n\nThis is a related tangent, but I just tried this:\n\n    $ git clone ... git.git\n    $ cd git.git\n    $ chmod a-w t/lib-gpg/* t/lib-gpg\n    $ make test\n\nwhich makes GPG related tests to fail, as running GPG with the GNUPGHOME\nset there involves writing into the files in the directory (or\nremoving and recreating).\n\nPerhaps GPG tests should create their own copy in the playpen (aka\n\"trash directory\") and use that as GNUPGHOME so that we do not have\nto write into the single shared directory?  I wonder if automated\nparallel tests can intermittently fail because of this...\n"},{"id":"251012","messageId":"544A6A4C.4070704@drmicha.warpmail.net","threadId":"37781","inReplyTo":"xmqq7fzru5do.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCHv2] push: heed user.signingkey for signed pushes","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-10-24T15:03:40Z","receivedAt":"2014-10-24T15:03:40Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano schrieb am 23.10.2014 um 00:05:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n>> push --signed promises to take user.signingkey as the signing key but\n>> fails to read the config.\n>>\n>> Make it do so.\n>>\n>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n>> ---\n>> Okay, I guess this is nicer. We do have the committer info in the env. Sorry.\n>>\n>>  builtin/push.c         |  13 ++++++++++++-\n>>  t/lib-gpg/trustdb.gpg  | Bin 1360 -> 1360 bytes\n>>  t/t5534-push-signed.sh |  44 ++++++++++++++++++++++++++++++++++++++++++++\n>>  3 files changed, 56 insertions(+), 1 deletion(-)\n> \n> Hmph, I simply forgot about that configuration, I guess.\n\nIt's easy to overlook: user.email is picked up by git_default_config,\nbut user.signingkey is not. In hindsight, gpg.signingkey might have been\na good choice, too.\n\n> What is this change to trustdb about, though?  The log message does\n> not say anything about it.\n\nOoops, I'm sorry. That must have sneaked in from running gpg with that\nhome to see which keys we have in the test env. No change in trustdb\nintended. Probably gpg did some automatic trustdb recalculations, even\nthough all I did was gpg --list-key.\n\n>>\n>> diff --git a/builtin/push.c b/builtin/push.c\n>> index ae56f73..a076b19 100644\n>> --- a/builtin/push.c\n>> +++ b/builtin/push.c\n>> @@ -471,6 +471,17 @@ static int option_parse_recurse_submodules(const struct option *opt,\n>>  \treturn 0;\n>>  }\n>>  \n>> +static int git_push_config(const char *k, const char *v, void *cb)\n>> +{\n>> +\tstruct wt_status *s = cb;\n>> +\tint status;\n>> +\n>> +\tstatus = git_gpg_config(k, v, NULL);\n>> +\tif (status)\n>> +\t\treturn status;\n>> +\treturn git_default_config(k, v, s);\n>> +}\n>> +\n>>  int cmd_push(int argc, const char **argv, const char *prefix)\n>>  {\n>>  \tint flags = 0;\n>> @@ -511,7 +522,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n>>  \t};\n>>  \n>>  \tpacket_trace_identity(\"push\");\n>> -\tgit_config(git_default_config, NULL);\n>> +\tgit_config(git_push_config, NULL);\n>>  \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n>>  \n>>  \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\n>> diff --git a/t/lib-gpg/trustdb.gpg b/t/lib-gpg/trustdb.gpg\n>> index 4879ae9a84650a93a4d15bd6560c5d1b89eb4c2f..c11b1464b3d13b45966a493e2174fc0e253ddd0c 100644\n>> GIT binary patch\n>> delta 47\n>> ncmcb>b%9HOF})z2nVFH5k%@sJ#C^}~iH71E)x}wb7%%_;=xPS!\n>>\n>> delta 51\n>> tcmcb>b%9HSF})z2nVFH5k%@sJ&}Z5*1_lPkiGso#)x}wb*nk{V008$D2C@JE\n>>\n>> diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh\n>> index 2786346..ecb8d44 100755\n>> --- a/t/t5534-push-signed.sh\n>> +++ b/t/t5534-push-signed.sh\n>> @@ -124,4 +124,48 @@ test_expect_success GPG 'signed push sends push certificate' '\n>>  \ttest_cmp expect dst/push-cert-status\n>>  '\n>>  \n>> +test_expect_success GPG 'fail without key and heed user.signingkey' '\n>> +\tprepare_dst &&\n>> +\tmkdir -p dst/.git/hooks &&\n>> +\tgit -C dst config receive.certnonceseed sekrit &&\n>> +\twrite_script dst/.git/hooks/post-receive <<-\\EOF &&\n>> +\t# discard the update list\n>> +\tcat >/dev/null\n>> +\t# record the push certificate\n>> +\tif test -n \"${GIT_PUSH_CERT-}\"\n>> +\tthen\n>> +\t\tgit cat-file blob $GIT_PUSH_CERT >../push-cert\n>> +\tfi &&\n>> +\n>> +\tcat >../push-cert-status <<E_O_F\n>> +\tSIGNER=${GIT_PUSH_CERT_SIGNER-nobody}\n>> +\tKEY=${GIT_PUSH_CERT_KEY-nokey}\n>> +\tSTATUS=${GIT_PUSH_CERT_STATUS-nostatus}\n>> +\tNONCE_STATUS=${GIT_PUSH_CERT_NONCE_STATUS-nononcestatus}\n>> +\tNONCE=${GIT_PUSH_CERT_NONCE-nononce}\n>> +\tE_O_F\n>> +\n>> +\tEOF\n>> +\n>> +\tunset GIT_COMMITTER_EMAIL &&\n>> +\tgit config user.email hasnokey@nowhere.com &&\n>> +\ttest_must_fail git push --signed dst noop ff +noff &&\n>> +\tgit config user.signingkey committer@example.com &&\n>> +\tgit push --signed dst noop ff +noff &&\n>> +\n>> +\t(\n>> +\t\tcat <<-\\EOF &&\n>> +\t\tSIGNER=C O Mitter <committer@example.com>\n>> +\t\tKEY=13B6F51ECDDE430D\n>> +\t\tSTATUS=G\n>> +\t\tNONCE_STATUS=OK\n>> +\t\tEOF\n>> +\t\tsed -n -e \"s/^nonce /NONCE=/p\" -e \"/^$/q\" dst/push-cert\n>> +\t) >expect &&\n>> +\n>> +\tgrep \"$(git rev-parse noop ff) refs/heads/ff\" dst/push-cert &&\n>> +\tgrep \"$(git rev-parse noop noff) refs/heads/noff\" dst/push-cert &&\n>> +\ttest_cmp expect dst/push-cert-status\n>> +'\n>> +\n>>  test_done\n"},{"id":"251013","messageId":"544A6D4E.7070408@drmicha.warpmail.net","threadId":"37781","inReplyTo":"xmqq38afu0of.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCHv2] push: heed user.signingkey for signed pushes","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-10-24T15:16:30Z","receivedAt":"2014-10-24T15:16:30Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano schrieb am 23.10.2014 um 01:47:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> Michael J Gruber <git@drmicha.warpmail.net> writes:\n>>\n>>> push --signed promises to take user.signingkey as the signing key but\n>>> fails to read the config.\n>>>\n>>> Make it do so.\n>>>\n>>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n>>> ---\n>>> Okay, I guess this is nicer. We do have the committer info in the env. Sorry.\n>>>\n>>>  builtin/push.c         |  13 ++++++++++++-\n>>>  t/lib-gpg/trustdb.gpg  | Bin 1360 -> 1360 bytes\n>>>  t/t5534-push-signed.sh |  44 ++++++++++++++++++++++++++++++++++++++++++++\n>>>  3 files changed, 56 insertions(+), 1 deletion(-)\n>>\n>> Hmph, I simply forgot about that configuration, I guess.\n>>\n>> What is this change to trustdb about, though?  The log message does\n>> not say anything about it.\n> \n> This is a related tangent, but I just tried this:\n> \n>     $ git clone ... git.git\n>     $ cd git.git\n>     $ chmod a-w t/lib-gpg/* t/lib-gpg\n>     $ make test\n> \n> which makes GPG related tests to fail, as running GPG with the GNUPGHOME\n> set there involves writing into the files in the directory (or\n> removing and recreating).\n> \n> Perhaps GPG tests should create their own copy in the playpen (aka\n> \"trash directory\") and use that as GNUPGHOME so that we do not have\n> to write into the single shared directory?  I wonder if automated\n> parallel tests can intermittently fail because of this...\n\nIf I do that, I get:\n\ngpg: can't create `/home/mjg/src/git/t/trash\ndirectory.t5534-push-signed/gpghome/random_seed': Permission denied\n\nSo I we do copy the env around. Problems arise only when the original\ncopy ends up ro. We can guard against that by doing:\n\ndiff --git i/t/lib-gpg.sh w/t/lib-gpg.sh\nindex fd499e7..972f10e 100755\n--- i/t/lib-gpg.sh\n+++ w/t/lib-gpg.sh\n@@ -17,7 +17,7 @@ else\n                # Name and email: C O Mitter <committer@example.com>\n                # No password given, to enable non-interactive operation.\n                cp -R \"$TEST_DIRECTORY\"/lib-gpg ./gpghome\n-               chmod 0700 gpghome\n+               chmod 0700 gpghome gpghome/*\n                GNUPGHOME=\"$(pwd)/gpghome\"\n                export GNUPGHOME\n                test_set_prereq GPG\n\nThat is we have partial guard in place already.\n\nI'll resend in proper format.\n\nMichael\n"},{"id":"251014","messageId":"e4a04b52ade76af3d2d53e865b20815a582f8171.1414164092.git.git@drmicha.warpmail.net","threadId":"37781","inReplyTo":"544A6D4E.7070408@drmicha.warpmail.net","subject":"[PATCH] t/lib-gpg: make gpghome files writable","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-10-24T15:23:32Z","receivedAt":"2014-10-24T15:23:32Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"t/lib-gpg.sh copies the test environment's gpg home to the trash\ndirectory and makes sure the directoty is writable.\n\nMake sure the copied files are writable, too.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/lib-gpg.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex fd499e7..cd2baef 100755\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -18,6 +18,7 @@ else\n \t\t# No password given, to enable non-interactive operation.\n \t\tcp -R \"$TEST_DIRECTORY\"/lib-gpg ./gpghome\n \t\tchmod 0700 gpghome\n+\t\tchmod 0600 gpghome/*\n \t\tGNUPGHOME=\"$(pwd)/gpghome\"\n \t\texport GNUPGHOME\n \t\ttest_set_prereq GPG\n-- \n2.1.2.756.gfa53a0a\n"},{"id":"251017","messageId":"xmqqk33ph0r1.fsf@gitster.dls.corp.google.com","threadId":"37781","inReplyTo":"544A6D4E.7070408@drmicha.warpmail.net","subject":"Re: [PATCHv2] push: heed user.signingkey for signed pushes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-24T16:48:50Z","receivedAt":"2014-10-24T16:48:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> If I do that, I get:\n>\n> gpg: can't create `/home/mjg/src/git/t/trash\n> directory.t5534-push-signed/gpghome/random_seed': Permission denied\n>\n> So I we do copy the env around. Problems arise only when the original\n> copy ends up ro. We can guard against that by doing:\n\nAh, thanks for digging it further.\n"},{"id":"251018","messageId":"xmqqfvedh0pt.fsf@gitster.dls.corp.google.com","threadId":"37781","inReplyTo":"544A6A4C.4070704@drmicha.warpmail.net","subject":"Re: [PATCHv2] push: heed user.signingkey for signed pushes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-24T16:49:34Z","receivedAt":"2014-10-24T16:49:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Ooops, I'm sorry. That must have sneaked in from running gpg with that\n> home to see which keys we have in the test env. No change in trustdb\n> intended. Probably gpg did some automatic trustdb recalculations, even\n> though all I did was gpg --list-key.\n\nOK, so it will be fine to queue the patch without the trustdb bits,\nI guess.\n\nThanks.\n"}]}