# git-receive-pack doesn't seem to respect gpg.program config

2 messages from 2020-10-26 to 2020-10-26. Participants: Konstantin Ryabitsev, Jeff King.
Thread: https://gitlist.dev/t/54510

## Konstantin Ryabitsev, 2020-10-26 18:16

Subject: git-receive-pack doesn't seem to respect gpg.program config
Message-ID: <20201026181625.c6f5y44ydndkniul@chatter.i7.local>
URL: https://gitlist.dev/e/20201026181625.c6f5y44ydndkniul%40chatter.i7.local

```
Hi, all:

While trying to configure signed pushes, I found out that no mater where 
I set gpg.program=/opt/gnupg22/bin/gpg (in-repo config, ~/.gitconfig, 
/etc/gitconfig), git-receive-pack didn't appear to be paying any 
attention to that setting and always used the "gpg" command in the PATH.

Not sure if that's intentional or not, but seems like it should be 
paying attention at least to /etc/gitconfig.

-K

```

## Jeff King, 2020-10-26 19:36

Subject: Re: git-receive-pack doesn't seem to respect gpg.program config
Message-ID: <20201026193644.GA16150@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20201026193644.GA16150%40coredump.intra.peff.net
In-Reply-To: <20201026181625.c6f5y44ydndkniul@chatter.i7.local>

```
On Mon, Oct 26, 2020 at 02:16:25PM -0400, Konstantin Ryabitsev wrote:

> While trying to configure signed pushes, I found out that no mater where 
> I set gpg.program=/opt/gnupg22/bin/gpg (in-repo config, ~/.gitconfig, 
> /etc/gitconfig), git-receive-pack didn't appear to be paying any 
> attention to that setting and always used the "gpg" command in the PATH.
> 
> Not sure if that's intentional or not, but seems like it should be 
> paying attention at least to /etc/gitconfig.

I suspect it just needs:

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index bb9909c52e..2a41b24e5a 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -248,6 +248,10 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
 		return 0;
 	}
 
+	status = git_gpg_config(var, value, cb);
+	if (status)
+		return status;
+
 	return git_default_config(var, value, cb);
 }
 

but didn't test or look further than that.

-Peff

```
