# git-tag -s can't find GPG private key

3 messages from 2010-01-27 to 2010-01-27. Participants: Mike.lifeguard, Sverre Rabbelier, Junio C Hamano.
Thread: https://gitlist.dev/t/22416

## Mike.lifeguard, 2010-01-27 21:02

Subject: git-tag -s can't find GPG private key
Message-ID: <4B60A9F0.5000904@gmail.com>
URL: https://gitlist.dev/e/4B60A9F0.5000904%40gmail.com

```
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

It seems that when the GPG key name and user.name in git's config are
different, git can't find the appropriate private key to sign the tag.
Git should attempt to use user.email to find the key. Setting
user.signingkey is of course a workaround. The relevant code would be in
builtin-tag.c.

- -Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAktgqewACgkQst0AR/DaKHuDZgCgpYHD05aJHKF/Wj/uU8CK5swP
SccAoMjHVKM/OZBhbvSvC+aWCQ123Tje
=ZIo0
-----END PGP SIGNATURE-----

```

## Sverre Rabbelier, 2010-01-27 21:06

Subject: Re: git-tag -s can't find GPG private key
Message-ID: <fabb9a1e1001271306o7e6d9abu1f370ed4698ac055@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e1001271306o7e6d9abu1f370ed4698ac055%40mail.gmail.com
In-Reply-To: <4B60A9F0.5000904@gmail.com>

```
Heya,

On Wed, Jan 27, 2010 at 22:02, Mike.lifeguard <mike.lifeguard@gmail.com> wrote:
> It seems that when the GPG key name and user.name in git's config are
> different, git can't find the appropriate private key to sign the tag.
> Git should attempt to use user.email to find the key. Setting
> user.signingkey is of course a workaround. The relevant code would be in
> builtin-tag.c.

It seems you already know where to look, why don't you try and come up
with a patch since it is indeed, your itch to scratch?

-- 
Cheers,

Sverre Rabbelier

```

## Junio C Hamano, 2010-01-27 21:16

Subject: Re: git-tag -s can't find GPG private key
Message-ID: <7v3a1rp7ta.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v3a1rp7ta.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4B60A9F0.5000904@gmail.com>

```
"Mike.lifeguard" <mike.lifeguard@gmail.com> writes:

> It seems that when the GPG key name and user.name in git's config are
> different, git can't find the appropriate private key to sign the tag.
> Git should attempt to use user.email to find the key. Setting
> user.signingkey is of course a workaround.

user.signingkey was devised for this exact case, and I don't think it is a
work-around.

I do not think "should attempt" is a correct attitude, even though I can
100% agree with "it would have been nicer if it attempted to do this from
day one".  You are unfortunately not interacting with git codebase in
early 2005 anymore and there are thousands if not millions of existing
users you should worry about.

Using user.email changes the behaviour for people who do not want a key
that has the same e-mail address, and because the choice of key is all
about security, the logic to choose which one shouldn't be changed
lightly.

```
