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

Re: Problem signing a tag

From
Joshua J. Kugler <joshua@eeinternet.com>
Date
Nov 4, 2009, 18:47 UTC
Message-ID
<200911040947.50226.joshua@eeinternet.com>
In-Reply-To
<4AF18F7A.2000904@drmicha.warpmail.net>
On Wednesday 04 November 2009, Michael J Gruber said something like:
Show 24 quoted lines
> > gpg: problem with the agent - disabling agent use
> > error: gpg failed to sign the tag
> > error: unable to sign the tag
> > $ echo $?
> > 128
> >
> > And when I sign at the prompt:
> >
> > $ gpg -sa
> >
> > You need a passphrase to unlock the secret key for
> > user: "Joshua J. Kugler <joshua@azariah.com>"
> > 1024-bit DSA key, ID 14EA086E, created 2009-08-09
> >
> > gpg: problem with the agent - disabling agent use
> > Blah blah blah blah
> > Blah blah blah blah
> > $ echo $?
> > 2
>
> [...]
>
> I assume you don't want to use gpg-agent, that should be the easy way
> out.
Well, I could, but I just haven't set it up. :)
> If that helps you can put "--no-use-agent" in your gpg config.
I commented out use-agent in the config. That worked. THANKS!
> 2 is a non-fatal error, 128 a fatal one, btw.

Well, the 2 was from running gpg alone, and 128 was from git erroring out. According to the gpg docs:

"The program returns 0 if everything was fine, 1 if at least a signature was bad, and other error codes for fatal errors."

So, the docs consider 2 a fatal error, even though it appears it isn't. It seems that http://github.com/git/git/blob/a6dbf8814f433a7fbfa9cde6333c98019f6db1e4/builtin-tag.c#L202 needs to be patched to something along the lines of:

rv = finish_command(&gpg) if ((rv && rv !=2) || !len || len < 0)

Probably digging in to the gpg source code to figure out what errors are and aren't fatal would be in order.

Thanks again for your help! Glad to know what I needed to do to sign my tags!

j
-- 
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0x14EA086E
Previous: Michael J GruberNext: Michael J Gruber
Message 5 of 10 in “Problem signing a tag”
  1. Joshua J. KuglerNov 3, 2009
  2. Alex RiesenNov 3, 2009
  3. Joshua J. KuglerNov 3, 2009
  4. Michael J GruberNov 4, 2009
  5. Joshua J. KuglerNov 4, 2009
  6. Michael J GruberNov 5, 2009
  7. Joshua J. KuglerNov 5, 2009
  8. Junio C HamanoNov 5, 2009
  9. Michael J GruberNov 6, 2009
  10. Joshua J. KuglerNov 9, 2009

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.