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

Re: [PATCH v2] log: Read gpg settings for signed commit verification

From
Jeff King <peff@peff.net>
Date
Mar 27, 2013, 16:22 UTC
Message-ID
<20130327162232.GB22386@sigill.intra.peff.net>
In-Reply-To
<7vip4com2p.fsf@alter.siamese.dyndns.org>
On Wed, Mar 27, 2013 at 09:15:58AM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> >  	}
> > -
> > +	if (git_gpg_config(var, value, cb) < 0)
> > +		return -1;
> >  	if (grep_config(var, value, cb) < 0)
> >  		return -1;
> 
> Hmph.  I do not particularly like the way the call to grep_config()
> loses information by not ignoring its return value and always
> returning -1, but I'll let it pass for this patch.

That's my fault for suggesting he follow the same style as grep here. But I wonder if it is worth the effort. We have never cared about anything beyond "was there an error" in our config callbacks, and the value returned from the callbacks is lost in git_parse_file (i.e., we do not propagate the actual return value, but only check that "callback(var, value, data) < 0", and die if so).

Existing callbacks pass data out by writing into a struct pointed to by the data pointer, which is more flexible, anyway.

So unless you want to overhaul the whole config system to propagate return codes back to the caller, I do not think there is any point in worrying about it.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “log: Read gpg settings for signed commit verification”
  1. log: Read gpg settings for signed commit verificationHans Brigman, Mar 27, 2013
  2. Junio C HamanoMar 27, 2013
  3. Jeff KingMar 27, 2013
  4. Junio C HamanoMar 27, 2013

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.