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

Re: [PATCH 1/2] config: document git config getter return value.

From
Jeff King <peff@peff.net>
Date
Aug 3, 2018, 13:05 UTC
Message-ID
<20180803130509.GB4671@sigill.intra.peff.net>
In-Reply-To
<20180803032948.GG197924@aiede.svl.corp.google.com>
On Thu, Aug 02, 2018 at 08:29:48PM -0700, Jonathan Nieder wrote:
> (cc-ing peff, config whiz)

Actually, this is all about the configset caching layer, which I never really worked on. This is mostly from Tanay Abhra <tanayabh@gmail.com>, who was a GSoC student mentored by Matthieu Moy <Matthieu.Moy@imag.fr>.

That said...
Show 9 quoted lines
> > +
> > +/*
> > + * These functions return 1 if not found, and 0 if found, leaving the found
> > + * value in the 'dest' pointer.
> > + */
> > +extern int git_configset_add_file(struct config_set *cs, const char *filename);
> 
> This function doesn't take a 'dest' argument.  Is the comment meant to
> apply to it?  If not, can the comment go below it?

This is returning the value of git_config_from_file(), which is 0/-1. I think it should be left where it is in the original, and not part of this block of functions.

Other than that, the patch seems sane to me (I think the 0/1 return value from these "get" functions is unnecessarily inconsistent with the rest of Git, but changing it would be a pain. Documenting it is at least a step forward).

-Peff
Previous: Jonathan NiederNext: Junio C Hamano
Message 5 of 10 in “sideband: highlight keywords in remote sideband output”
  1. 0/2 sideband: highlight keywords in remote sideband outputHan-Wen Nienhuys, Aug 2, 2018
  2. 1/2 config: document git config getter return value.Han-Wen Nienhuys, Aug 2, 2018
  3. Eric SunshineAug 2, 2018
  4. Jonathan NiederAug 3, 2018
  5. Jeff KingAug 3, 2018
  6. Junio C HamanoAug 3, 2018
  7. 2/2 sideband: highlight keywords in remote sideband outputHan-Wen Nienhuys, Aug 2, 2018
  8. Eric SunshineAug 3, 2018
  9. Jonathan NiederAug 3, 2018
  10. Han-Wen NienhuysAug 6, 2018

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.