{"thread":{"id":"39909","subject":"[PATCH] builtin/send-pack.c: Respect http.signingkey","startedAt":"2015-07-21T22:06:43Z","lastAt":"2015-07-21T22:24:19Z","messageCount":2,"participants":["Dave Borowitz","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"266593","messageId":"1437516403-13622-1-git-send-email-dborowitz@google.com","threadId":"39909","inReplyTo":null,"subject":"[PATCH] builtin/send-pack.c: Respect http.signingkey","fromName":"Dave Borowitz","fromEmail":"dborowitz@google.com","sentAt":"2015-07-21T22:06:43Z","receivedAt":"2015-07-21T22:06:43Z","isPatch":true,"sender":{"key":"dborowitz@google.com","avatar":"https://avatars.githubusercontent.com/u/194927?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nPrior to this patch, when git-send-pack was exec'ed, as is done by\ngit-remote-http, it did not reread the config, so it did not respect\nthe configured value of http.signingkey. Thus it was impossible to\nspecify a signing key over HTTP, other than the default key in the\nkeyring having a User ID matching the \"Name <email>\" format.\n\nThis patch at least partially fixes the problem by reading in the GPG\nconfig from within send-pack. It does not address the related problem\nof plumbing a value for this configuration option using\n`git -c http.signingkey push ...`.\n\nSigned-off-by: Dave Borowitz <dborowitz@google.com>\n---\n builtin/send-pack.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex b961e5a..23b2962 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -11,6 +11,7 @@\n #include \"transport.h\"\n #include \"version.h\"\n #include \"sha1-array.h\"\n+#include \"gpg-interface.h\"\n \n static const char send_pack_usage[] =\n \"git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [--atomic] [<host>:]<directory> [<ref>...]\\n\"\n@@ -113,6 +114,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)\n \tint from_stdin = 0;\n \tstruct push_cas_option cas = {0};\n \n+\tgit_config(git_gpg_config, NULL);\n+\n \targv++;\n \tfor (i = 1; i < argc; i++, argv++) {\n \t\tconst char *arg = *argv;\n-- \n2.4.3.573.g4eafbef\n"},{"id":"266596","messageId":"xmqqk2ttrvxo.fsf@gitster.dls.corp.google.com","threadId":"39909","inReplyTo":"1437516403-13622-1-git-send-email-dborowitz@google.com","subject":"Re: [PATCH] builtin/send-pack.c: Respect http.signingkey","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-21T22:24:19Z","receivedAt":"2015-07-21T22:24:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dave Borowitz <dborowitz@google.com> writes:\n\n> From: Junio C Hamano <gitster@pobox.com>\n>\n> Prior to this patch, when git-send-pack was exec'ed, as is done by\n> git-remote-http, it did not reread the config, so it did not respect\n> the configured value of http.signingkey. Thus it was impossible to\n> specify a signing key over HTTP, other than the default key in the\n> keyring having a User ID matching the \"Name <email>\" format.\n>\n> This patch at least partially fixes the problem by reading in the GPG\n> config from within send-pack. It does not address the related problem\n> of plumbing a value for this configuration option using\n> `git -c http.signingkey push ...`.\n\nI am hoping that \"git -c user.signingkey=frotz push ...\" would solve\nthat problem, but I probably am being too optimistic ;-)\n\nThanks.\n\n>\n> Signed-off-by: Dave Borowitz <dborowitz@google.com>\n> ---\n>  builtin/send-pack.c | 3 +++\n>  1 file changed, 3 insertions(+)\n>\n> diff --git a/builtin/send-pack.c b/builtin/send-pack.c\n> index b961e5a..23b2962 100644\n> --- a/builtin/send-pack.c\n> +++ b/builtin/send-pack.c\n> @@ -11,6 +11,7 @@\n>  #include \"transport.h\"\n>  #include \"version.h\"\n>  #include \"sha1-array.h\"\n> +#include \"gpg-interface.h\"\n>  \n>  static const char send_pack_usage[] =\n>  \"git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [--atomic] [<host>:]<directory> [<ref>...]\\n\"\n> @@ -113,6 +114,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)\n>  \tint from_stdin = 0;\n>  \tstruct push_cas_option cas = {0};\n>  \n> +\tgit_config(git_gpg_config, NULL);\n> +\n>  \targv++;\n>  \tfor (i = 1; i < argc; i++, argv++) {\n>  \t\tconst char *arg = *argv;\n"}]}