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

Re: [PATCH v3 2/3] config: add hashtable for config parsing & retrieval

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2014, 20:53 UTC
Message-ID
<xmqqk38490d5.fsf@gitster.dls.corp.google.com>
In-Reply-To
<53AB2FAA.0@gmail.com>
Karsten Blees <karsten.blees@gmail.com> writes:
Show 10 quoted lines
> Am 25.06.2014 20:13, schrieb Junio C Hamano:
>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>>> I had expected to see one hash table per file/blob, with the three
>>> standard config hash tables linked together to implement the scope/
>>> priority rules. (Well, these could be merged into one, as the current
>>> code does, since that makes handling "multi" keys slightly easier).
>> 
>> Again, good point....
>
> Is this additional complexity really necessary?

Nothing is *really* necessary ;-) and it is possible that the best balance may be at "parse a single chain of files into a single hashtable for a config-set, and if anything changes, re-read everything from scratch".

The point Ramsay raised about being able to share the pre-parsed $HOME/.gitconfig across multiple config-sets (one for the top-level superproject, and the others for submodules, when having to work across module boundaries) triggered this thought experiment (aka "I am not married to the approach") to use one table per source. If we wanted to take advantage of updating a single file and not having to re-read the whole thing, includes need to be handled a bit more carefully than "one config-file for one source", as you noticed, and a single source may have to be split into multiple pieces.

And it is possible that the complexity necessary to do these correctly may make it not worth pursuing the approach. Or it may not. I don't know at this point, and thinking these things through to arrive at a good design is part of the GSoC project after all, so I'd rather not to think it through to the end myself ;-).

> What's the use case for this? Do you expect e.g. 'git gc' to
> detect changed depth/window size at run time and adjust the
> algorithm accordingly?

I did write "detect" but I think a more realistic example is that we do git-config-set internally and wish to see the effect inside the same process (i.e. something like "pull --set-upstream" that sets configuration variable for later invocations and also perform the operation with the configuration in effect at the same time).

Previous: Karsten BleesNext: Matthieu Moy
Message 20 of 35 in “git config cache & special querying api utilizing the cache”
  1. 0/3 git config cache & special querying api utilizing the cacheTanay Abhra, Jun 23, 2014
  2. 1/3 string-list: add string_list initialiser helper functionsTanay Abhra, Jun 23, 2014
  3. Torsten BögershausenJun 23, 2014
  4. Tanay AbhraJun 23, 2014
  5. 2/3 config: add hashtable for config parsing & retrievalTanay Abhra, Jun 23, 2014
  6. Matthieu MoyJun 23, 2014
  7. Tanay AbhraJun 24, 2014
  8. Karsten BleesJun 25, 2014
  9. Ramsay JonesJun 23, 2014
  10. Tanay AbhraJun 23, 2014
  11. Ramsay JonesJun 24, 2014
  12. Matthieu MoyJun 26, 2014
  13. Junio C HamanoJun 23, 2014
  14. Tanay AbhraJun 24, 2014
  15. Junio C HamanoJun 25, 2014
  16. Tanay AbhraJun 24, 2014
  17. Ramsay JonesJun 24, 2014
  18. Junio C HamanoJun 25, 2014
  19. Karsten BleesJun 25, 2014
  20. Junio C HamanoJun 25, 2014
  21. Matthieu MoyJun 26, 2014
  22. Junio C HamanoJun 26, 2014
  23. Karsten BleesJun 26, 2014
  24. Junio C HamanoJun 26, 2014
  25. Karsten BleesJun 27, 2014
  26. Matthieu MoyJun 27, 2014
  27. Junio C HamanoJun 27, 2014
  28. Junio C HamanoJun 23, 2014
  29. Tanay AbhraJun 24, 2014
  30. Matthieu MoyJun 26, 2014
  31. Karsten BleesJun 25, 2014
  32. Matthieu MoyJun 26, 2014
  33. 3/3 test-config: add usage examples for non-callback query functionsTanay Abhra, Jun 23, 2014
  34. Eric SunshineJun 25, 2014
  35. Tanay AbhraJun 26, 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.