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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 9, 2014, 17:44 UTC
Message-ID
<xmqq38ea77gt.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqqmwci7e9p.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
>> * Still, making sure that the (file, line) is doable later without too
>>   much change is good. So, if indeed, moving all code to another file is
>>   required, then it may make sense to do it now to avoid code move
>>   later.
>
> Good thinking.  As long as the code is prepared, it is a good idea
> to start small and bite off only we can chew at once, do things
> incrementally.

After thinking about it a bit more, I think <file, line> support needs to be done not as a mere client of the generic, uncached git_config() API that we have had for forever, like the current iteration, but needs to know a bit more about the state the caller of the callback (namely, git_parse_source()), and we obviously do not want to expose that machinery to anybody other than the implementation of the config subsystem (to which the new facility this GSoC project adds belongs to), so in that sense you have to have your code in the same config.c file anyway.

It is somewhat dissapointing that this initial implementation was done as a client of the traditional git_config(), by the way. I would have expected that it would be the other way around, in that the traditional callers of git_config() would behefit automatically by having the cache layer below it.

But we have to start from somewhere. Perhaps the round after this one can rename the exisiting implementation of git_config() to something else internal to the caching layer and give the existing callers a compatible interface that is backed by this new caching layer in a transparent way.

Previous: Junio C HamanoNext: Matthieu Moy
Message 7 of 14 in “git config cache & special querying api utilizing the cache”
  1. 0/3 git config cache & special querying api utilizing the cacheTanay Abhra, Jul 9, 2014
  2. 1/2 add `config_set` API for caching config-like filesTanay Abhra, Jul 9, 2014
  3. Matthieu MoyJul 9, 2014
  4. Tanay AbhraJul 9, 2014
  5. Matthieu MoyJul 9, 2014
  6. Junio C HamanoJul 9, 2014
  7. Junio C HamanoJul 9, 2014
  8. Matthieu MoyJul 10, 2014
  9. Junio C HamanoJul 10, 2014
  10. Tanay AbhraJul 9, 2014
  11. Matthieu MoyJul 10, 2014
  12. 2/2 test-config: Add tests for the config_set APITanay Abhra, Jul 9, 2014
  13. Matthieu MoyJul 9, 2014
  14. Tanay AbhraJul 9, 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.