{"thread":{"id":"54510","subject":"git-receive-pack doesn't seem to respect gpg.program config","startedAt":"2020-10-26T18:16:30Z","lastAt":"2020-10-26T19:36:47Z","messageCount":2,"participants":["Konstantin Ryabitsev","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"408432","messageId":"20201026181625.c6f5y44ydndkniul@chatter.i7.local","threadId":"54510","inReplyTo":null,"subject":"git-receive-pack doesn't seem to respect gpg.program config","fromName":"Konstantin Ryabitsev","fromEmail":"konstantin@linuxfoundation.org","sentAt":"2020-10-26T18:16:25Z","receivedAt":"2020-10-26T18:16:30Z","isPatch":false,"sender":{"key":"konstantin@linuxfoundation.org","avatar":"https://gravatar.com/avatar/7cb8827c6de56e1bd2dea16508c6708aa43feed3bf3813bcdacecdf96ceadd79?d=mp&s=160"},"body":"Hi, all:\n\nWhile trying to configure signed pushes, I found out that no mater where \nI set gpg.program=/opt/gnupg22/bin/gpg (in-repo config, ~/.gitconfig, \n/etc/gitconfig), git-receive-pack didn't appear to be paying any \nattention to that setting and always used the \"gpg\" command in the PATH.\n\nNot sure if that's intentional or not, but seems like it should be \npaying attention at least to /etc/gitconfig.\n\n-K\n"},{"id":"408448","messageId":"20201026193644.GA16150@coredump.intra.peff.net","threadId":"54510","inReplyTo":"20201026181625.c6f5y44ydndkniul@chatter.i7.local","subject":"Re: git-receive-pack doesn't seem to respect gpg.program config","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-10-26T19:36:44Z","receivedAt":"2020-10-26T19:36:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 26, 2020 at 02:16:25PM -0400, Konstantin Ryabitsev wrote:\n\n> While trying to configure signed pushes, I found out that no mater where \n> I set gpg.program=/opt/gnupg22/bin/gpg (in-repo config, ~/.gitconfig, \n> /etc/gitconfig), git-receive-pack didn't appear to be paying any \n> attention to that setting and always used the \"gpg\" command in the PATH.\n> \n> Not sure if that's intentional or not, but seems like it should be \n> paying attention at least to /etc/gitconfig.\n\nI suspect it just needs:\n\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex bb9909c52e..2a41b24e5a 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -248,6 +248,10 @@ static int receive_pack_config(const char *var, const char *value, void *cb)\n \t\treturn 0;\n \t}\n \n+\tstatus = git_gpg_config(var, value, cb);\n+\tif (status)\n+\t\treturn status;\n+\n \treturn git_default_config(var, value, cb);\n }\n \n\nbut didn't test or look further than that.\n\n-Peff\n"}]}