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

[PATCH v1] Git config cache & special querying api utilizing the cache

From
Tanay Abhra <tanayabh@gmail.com>
Date
Jun 9, 2014, 12:49 UTC
Message-ID
<1402318146-5062-1-git-send-email-tanayabh@gmail.com>
Hi,
I am taking this patch out of RFC.
[PATCH V1]:Most of the invaluable suggestions by Eric Sunshine, Torsten Bogershausen and
	Jeff King has been implemented[1]. Complete rewrite of config_cache*() family
	using git_config() as hook as suggested by Jeff. Thanks for the review.
[RFC V2]: Improved according to the suggestions by Eric Sunshine and Torsten Bogershausen.
	Added cache invalidation when config file is changed.[2]
	I am using git_config_set_multivar_in_file() as an update hook.

This is my first patch for this year's GSoC. My project is "Git Config API improvements". The link of my proposal is appended below [3].

The aim of this patch series is to generate a cache for querying values from the config files in a non-callback manner as the current method reads and parses the config files every time a value is queried for.

The cache is generated from hooking the update_cache function to the current parsing and callback mechanism in config.c. It is implemented as an hashmap using the hashmap-api with variables and its corresponding values list as its members. The values in the list are sorted in order of increasing priority. The cache is initialised the first time when any of the new query functions is called. It is invalidated by using git_config_set_multivar_in_file() as an update hook.

We add two new functions to the config-api, git_config_get_string() and git_config_get_string_multi() for querying in a non callback manner from the cache.

I have run the tests and debug the code using custom functions and it works fine.

[1] http://marc.info/?t=140172066200006&r=1&w=2 [2] http://git.661346.n2.nabble.com/RFC-PATCH-0-2-Git-config-cache-amp-special-querying-api-utilizing-the-cache-td7611691.html [3] https://drive.google.com/file/d/0B4suZ-aHqDcnSUZJRXVTTnZUN1E/edit?usp=sharing

Cheers, Tanay Abhra.

Tanay Abhra (1):
  config: Add hashtable for config parsing & retrival
 Documentation/technical/api-config.txt |  18 +++++
 cache.h                                |   2 +
 config.c                               | 122 +++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+)
-- 
1.9.0.GIT
Next: Tanay Abhra
Message 1 of 11 in “Git config cache & special querying api utilizing the cache”
  1. Git config cache & special querying api utilizing the cacheTanay Abhra, Jun 9, 2014
  2. config: Add hashtable for config parsing & retrivalTanay Abhra, Jun 9, 2014
  3. Matthieu MoyJun 9, 2014
  4. Eric SunshineJun 10, 2014
  5. Eric SunshineJun 10, 2014
  6. Tanay AbhraJun 10, 2014
  7. Eric SunshineJun 10, 2014
  8. Eric SunshineJun 10, 2014
  9. Tanay AbhraJun 10, 2014
  10. Eric SunshineJun 10, 2014
  11. Matthieu MoyJun 11, 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.