git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH v2 0/2] Git config cache & special querying api utilizing the cache
@ 2014-06-02 14:47 Tanay Abhra
  2014-06-02 14:47 ` [RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval Tanay Abhra
  2014-06-02 14:47 ` [RFC/PATCH v2 2/2] config: Add new query functions to the api docs Tanay Abhra
  0 siblings, 2 replies; 7+ messages in thread
From: Tanay Abhra @ 2014-06-02 14:47 UTC (permalink / raw)
  To: git; +Cc: Tanay Abhra, Ramkumar Ramachandra, Matthieu Moy, Eric Sunshine

Hi,

[V2]: Improved according to the suggestions by Eric Sunshine and Torsten Bogershausen.
      Added cache invalidation when config file is changed.
      I am using git_config_set_multivar_in_file() as an update hook.

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

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 in git_config_early() as it is the first time a `git_config`
function is called during program startup. setup_git_directory_gently() calls
git_config_early() which in turn reads every config file (local, user and
global config files).

get_value() in config.c feeds variable and values into the callback function.
Using this function as a hook, we update the cache. Also, 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 and it works, but I have to add a
few things,

1. Metadata about the variables and values. I have added only the file
   from each variable value pair comes in an upcoming series.

What else should I add or implement ;is my approach right? 

[1] https://drive.google.com/file/d/0B4suZ-aHqDcnSUZJRXVTTnZUN1E/edit?usp=sharing

Cheers,
Tanay Abhra.

Tanay Abhra (2):
  config: Add hashtable for config parsing & retrieval
  config: Add new query functions to the api docs

 Documentation/technical/api-config.txt |  18 +++++
 cache.h                                |   2 +
 config.c                               | 118 +++++++++++++++++++++++++++++++++
 3 files changed, 138 insertions(+)

-- 
1.9.0.GIT

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-09  8:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-02 14:47 [RFC/PATCH v2 0/2] Git config cache & special querying api utilizing the cache Tanay Abhra
2014-06-02 14:47 ` [RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval Tanay Abhra
2014-06-02 19:33   ` Torsten Bögershausen
2014-06-03  7:58   ` Jeff King
2014-06-09  8:17   ` Eric Sunshine
2014-06-02 14:47 ` [RFC/PATCH v2 2/2] config: Add new query functions to the api docs Tanay Abhra
2014-06-03 15:35   ` Matthieu Moy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).