Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-10 Thread Eric Sunshine
One other minor point... On Mon, Jun 9, 2014 at 8:49 AM, Tanay Abhra wrote: > Subject: config: Add hashtable for config parsing & retrival s/retrival/retrieval/ > Add a hash table to cache all key-value pairs read from config files > (repo specific .git/config, user wide ~/.gitconfig and the gl

Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-10 Thread Eric Sunshine
On Tue, Jun 10, 2014 at 8:35 AM, Tanay Abhra wrote: > Thanks for the review, Eric. I have replied to your comments below, > I will try to reply early and more promptly now. Thanks for responding. More below. > On 06/10/2014 04:27 AM, Eric Sunshine wrote: >>> --- >>> diff --git a/config.c b/confi

Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-10 Thread Tanay Abhra
On 06/10/2014 04:45 AM, Eric Sunshine wrote: > One additional comment... > > On Mon, Jun 9, 2014 at 8:49 AM, Tanay Abhra wrote: >> +static int config_cache_set_value(const char *key, const char *value) >> +{ >> + struct hashmap *config_cache; >> + struct config_cache_entry *e; >> + >>

Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-10 Thread Tanay Abhra
Hi, Thanks for the review, Eric. I have replied to your comments below, I will try to reply early and more promptly now. On 06/10/2014 04:27 AM, Eric Sunshine wrote: >> --- >> diff --git a/Documentation/technical/api-config.txt >> b/Documentation/technical/api-config.txt >> index 230b3a0..5b6e37

Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-10 Thread Eric Sunshine
On Mon, Jun 9, 2014 at 10:24 AM, Matthieu Moy wrote: > Tanay Abhra writes: >> +struct config_cache_entry { >> + struct hashmap_entry ent; >> + char *key; >> + struct string_list *value_list; >> +}; > > I guess this crossed Eric's remark about the fact that this is a > pointer. > >> +s

Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-10 Thread Eric Sunshine
One additional comment... On Mon, Jun 9, 2014 at 8:49 AM, Tanay Abhra wrote: > +static int config_cache_set_value(const char *key, const char *value) > +{ > + struct hashmap *config_cache; > + struct config_cache_entry *e; > + > + config_cache = get_config_cache(); > + e =

Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-10 Thread Eric Sunshine
On Mon, Jun 9, 2014 at 8:49 AM, Tanay Abhra wrote: > Add a hash table to cache all key-value pairs read from config files > (repo specific .git/config, user wide ~/.gitconfig and the global > /etc/gitconfig). Add two external functions `git_config_get_string` and > `git_config_get_string_multi` fo

Re: [PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-09 Thread Matthieu Moy
Tanay Abhra writes: > +the highest priority(i.e. for the same variable value in the repo config ^ missing space. > +struct config_cache_entry { > + struct hashmap_entry ent; > + char *key; > + struct string_list *value_list; > +}; I guess this crossed Eric's r

[PATCH v1] config: Add hashtable for config parsing & retrival

2014-06-09 Thread Tanay Abhra
Add a hash table to cache all key-value pairs read from config files (repo specific .git/config, user wide ~/.gitconfig and the global /etc/gitconfig). Add two external functions `git_config_get_string` and `git_config_get_string_multi` for querying in a non-callback manner from the hash table. Si