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

Re: [PATCH 1/2] docs: add a basic description of the config API

From
Jeff King <peff@peff.net>
Date
Feb 8, 2012, 15:48 UTC
Message-ID
<20120208154855.GC8773@sigill.intra.peff.net>
In-Reply-To
<7vmx8tzv3l.fsf@alter.siamese.dyndns.org>
On Tue, Feb 07, 2012 at 10:40:14PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> What I was getting at is that we probably should officially declare that
> returning 1 to signal success is perfectly acceptable (and it probably
> should mean the caller who called the callback function as a sub callback
> should return immediately, taking it as a signal that the key has already
> been handled), as the primary purpose of this thread to discuss Peff's
> patch is to write these rules down.
> 
> Of course, all that relies on the audit of the git_config() machinery. I
> think it is written to accept non-negative as success, and that is why I
> said "I too think this should be acceptable" in the first place.

I looked through it the other day when this came up, and I believe that is the case. There is another related rule that should be considered, though: should the return value from callbacks be propagated via git_config to its caller?

It is the case already for config files that are read, but not for config options parsed from the command line. It would not be too hard to change, but I do not think any current callers care (as I mentioned earlier, these days with the "void *" data pointer, sane callers will simply pass in a pointer to a modifiable data area).

-Peff
Previous: Jeff KingNext: Jeff King
Message 12 of 16 in “config includes 3: revenge of the killer includes”
  1. 0/2 config includes 3: revenge of the killer includesJeff King, Feb 6, 2012
  2. 1/2 docs: add a basic description of the config APIJeff King, Feb 6, 2012
  3. Junio C HamanoFeb 6, 2012
  4. Jeff KingFeb 7, 2012
  5. Jeff KingFeb 7, 2012
  6. Junio C HamanoFeb 7, 2012
  7. Junio C HamanoFeb 7, 2012
  8. Nguyen Thai Ngoc DuyFeb 8, 2012
  9. Junio C HamanoFeb 8, 2012
  10. Nguyen Thai Ngoc DuyFeb 8, 2012
  11. Jeff KingFeb 8, 2012
  12. Jeff KingFeb 8, 2012
  13. Jeff KingFeb 7, 2012
  14. 2/2 config: add include directiveJeff King, Feb 6, 2012
  15. Junio C HamanoFeb 6, 2012
  16. Jeff KingFeb 7, 2012

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.