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

RFC GSoC idea: git configuration caching (needs co-mentor!)

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Mar 6, 2014, 05:57 UTC
Message-ID
<53180E40.5050308@alum.mit.edu>

I just wrote up the idea that fell out of the discussion [1] about the other configuration features that I proposed. As far as I am concerned, it can be merged as soon as somebody volunteers as a co-mentor. The idea is embodied in a pull request against the git.github.io repository [2]; the text is also appended below for your convenience.

Michael

[1] http://article.gmane.org/gmane.comp.version-control.git/242952 [2] https://github.com/git/git.github.io/pull/7

### git configuration API improvements

There are many places in Git that need to read a configuration value. Currently, each such site calls `git_config()`, which reads and parses the configuration files every time that it is called. This is wasteful, because it results in the configuration files being processed multiple times during a single `git` invocation. It also prevents the implementation of potential new features, like adding syntax to allow a configuration file to unset a previously-set value.

This goal of this project is to make configuration work as follows:
* Read the configuration from files once and cache the results in an
  appropriate data structure in memory.
* Change `git_config()` to iterate through the pre-read values in
  memory rather than re-reading the configuration files.
* Add new API calls that allow the cache to be inquired easily and
  efficiently.  Rewrite other functions like `git_config_int()` to be
  cache-aware.
* Rewrite callers to use the new API wherever possible.

You will need to consider how to handle other config API entry points like `git_config_early()` and `git_config_from_file()`, as well as how to invalidate the cache correctly in the case that the configuration is changed while `git` is executing.

See [this mailing list thread](http://article.gmane.org/gmane.comp.version-control.git/242952) for some discussion about this and related ideas.

 - Language: C
 - Difficulty: medium
 - Possible mentors: Michael Haggerty
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Next: Junio C Hamano
Message 1 of 4 in “RFC GSoC idea: git configuration caching (needs co-mentor!)”
  1. Michael HaggertyMar 6, 2014
  2. Junio C HamanoMar 6, 2014
  3. Jeff KingMar 6, 2014
  4. Michael HaggertyMar 6, 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.