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

Re: [PATCH v9r2 1/2] add `config_set` API for caching config-like files

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 16, 2014, 16:06 UTC
Message-ID
<vpqha2h9tjw.fsf@anie.imag.fr>
In-Reply-To
<53C66E70.3050507@gmail.com>
Tanay Abhra <tanayabh@gmail.com> writes:
Show 8 quoted lines
> implemented as a thin wrapper around the `config_set` API.
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
>  Documentation/technical/api-config.txt | 137 +++++++++++++++++
>  cache.h                                |  30 ++++
>  config.c                               | 264 +++++++++++++++++++++++++++++++++
>  3 files changed, 431 insertions(+)
(you broke the patch by removing the ---)
Show 7 quoted lines
> +static void git_config_check_init(void)
> +{
> +	if (the_config_set.hash_initialized)
> +		return;
> +	git_configset_init(&the_config_set);
> +	git_config(config_set_callback, &the_config_set);
> +}

So, you're now ignoring the return value of git_config. What is the rationale for this? In particular, why did you reject the "die" possibility (I understood that you were inclined to take this option, so I'm curious why you changed your mind).

OTOH, you're transmitting the return value without dying here:

+int git_configset_add_file(struct config_set *cs, const char *filename) +{ + return git_config_from_file(config_set_callback, filename, cs); +}

and I think this one is correct, as we cannot tell in advance how serious an error would be for any callers. And we do test this (I think we can improve a bit, I'll send a fixup patch).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Tanay AbhraNext: Matthieu Moy
Message 13 of 26 in “git config cache & special querying api utilizing the cache”
  1. 0/3 git config cache & special querying api utilizing the cacheTanay Abhra, Jul 15, 2014
  2. 1/2 add `config_set` API for caching config-like filesTanay Abhra, Jul 15, 2014
  3. Junio C HamanoJul 15, 2014
  4. Tanay AbhraJul 15, 2014
  5. 1/2 add `config_set` API for caching config-like filesTanay Abhra, Jul 16, 2014
  6. 2/2 test-config: add tests for the config_set APITanay Abhra, Jul 15, 2014
  7. Junio C HamanoJul 15, 2014
  8. Tanay AbhraJul 15, 2014
  9. Junio C HamanoJul 15, 2014
  10. 2/2 test-config: add tests for the config_set APITanay Abhra, Jul 16, 2014
  11. Matthieu MoyJul 16, 2014
  12. 1/2 add `config_set` API for caching config-like filesTanay Abhra, Jul 16, 2014
  13. Matthieu MoyJul 16, 2014
  14. 1/3 fixup for patch 2: minor style fixMatthieu Moy, Jul 16, 2014
  15. 2/3 fixup for patch 2: actually check the return valueMatthieu Moy, Jul 16, 2014
  16. Tanay AbhraJul 16, 2014
  17. Matthieu MoyJul 16, 2014
  18. 3/3 fixup for patch 1: typoMatthieu Moy, Jul 16, 2014
  19. Tanay AbhraJul 16, 2014
  20. Matthieu MoyJul 16, 2014
  21. 2/2 test-config: add tests for the config_set APITanay Abhra, Jul 16, 2014
  22. Matthieu MoyJul 17, 2014
  23. Tanay AbhraJul 17, 2014
  24. Matthieu MoyJul 17, 2014
  25. Matthieu MoyJul 17, 2014
  26. Junio C HamanoJul 17, 2014

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.