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
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 2, 2018, 17:19 UTC
Message-ID
<CAPig+cTFmNsxa4bSdUN199Q8YcJz74jn4Ytc3=JezaE-J595Og@mail.gmail.com>
In-Reply-To
<20180802121308.17371-2-hanwen@google.com>
On Thu, Aug 2, 2018 at 8:13 AM Han-Wen Nienhuys <hanwen@google.com> wrote:
Show 14 quoted lines
> diff --git a/config.h b/config.h
> @@ -178,10 +178,16 @@ struct config_set {
>  extern void git_configset_init(struct config_set *cs);
> -extern int git_configset_add_file(struct config_set *cs, const char *filename);
> -extern int git_configset_get_value(struct config_set *cs, const char *key, const char **value);
> +/*
> + * 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);
> +extern int git_configset_get_value(struct config_set *cs, const char *key, const char **dest);
>  extern int git_configset_get_string_const(struct config_set *cs, const char *key, const char **dest);
>  extern int git_configset_get_string(struct config_set *cs, const char *key, char **dest);
>  extern int git_configset_get_int(struct config_set *cs, const char *key, int *dest);

It doesn't seem like git_configset_add_file() fits in this group. It's neither searching for something (thus won't return "found" / "not found"), nor is it returning 0 or 1. (It returns 0 on success and -1 on failure.)

Previous: Han-Wen NienhuysNext: Jonathan Nieder
Message 3 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.