git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Signed git-tag doesn't find default key

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 20, 2006, 16:32 UTC
Message-ID
<Pine.LNX.4.64.0610200922170.3962@g5.osdl.org>
In-Reply-To
<200610201004.17263.andyparkins@gmail.com>
On Fri, 20 Oct 2006, Andy Parkins wrote:
Show 7 quoted lines
> 
> I did this:
> 
> $ git tag -s adp-sign-tag
> gpg: skipped "Andy Parkins <andyparkins@gmail.com>": secret key not available
> gpg: signing failed: secret key not available
> failed to sign the tag with GPG.
I would suggest one of two things:
 - specify the signing entity explicitly:
	git tag -u "andyparkins@gmail.com" adp-sign-tag
 - or just add a new alternate user ID to match the full git user ID.

Currently, your pgp key has the full ID "Andy Parkins (Google) <andyparkins@gmail.com>", and the way gpg matches ID's, that will _not_ match an ID of "Andy Parkins <andyparkins@gmail.com>"

But you can just do something like
	gpg --edit-key andyparkins@gmail.com

and then do an "adduid", and then add your UID _without_ the "(Google)" in there, and that should solve all your problems.

Show 8 quoted lines
> So when git-tag looks for "Andy Parkins <andyparkins@gmail.com>"; it's not 
> found.  The answer is (I think) to search only on the email address when 
> looking for a key.  I've simply changed git-tag to have
> 
> username=$(git-repo-config user.email)
> 
> However, this is clearly wrong as what it actually wants is the committer 
> email.  Am I safe to simply process the $tagger variable to extract it?
You're probably better off with something like
	git var GIT_COMMITTER_IDENT | sed 's/\(.*\)<\(.*\)>\(.*\)/\2/'

which should work, but see above: I think you literally are better off just adding an alias to your PGP key that doesn't have the comment field.

That said, I've never understood why gpg matches on the comment field. Dammit, it _should_ find the key anyway. Stupid program.

		Linus
Previous: Andy ParkinsNext: Andy Parkins
Message 2 of 3 in “Signed git-tag doesn't find default key”
  1. Andy ParkinsOct 20, 2006
  2. Linus TorvaldsOct 20, 2006
  3. Andy ParkinsOct 20, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.