Re: [PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
On 7/15/2014 9:16 PM, Junio C Hamano wrote: > Tanay Abhra writes: > >> diff --git a/config.c b/config.c >> index ba882a1..89e2d67 100644 >> --- a/config.c >> +++ b/config.c >> ... >> +const struct string_list *git_configset_get_value_multi(struct config_set >> *cs, const char *key) >> +{ >> +

Re: [PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Junio C Hamano
Tanay Abhra writes: > diff --git a/config.c b/config.c > index ba882a1..89e2d67 100644 > --- a/config.c > +++ b/config.c > ... > +const struct string_list *git_configset_get_value_multi(struct config_set > *cs, const char *key) > +{ > + struct config_set_element *e = configset_find_element(c

[PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
Currently `git_config()` uses a callback mechanism and file rereads for config values. Due to this approach, it is not uncommon for the config files to be parsed several times during the run of a git program, with different callbacks picking out different variables useful to themselves. Add a `con