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

2014-07-24 Thread Junio C Hamano
Tanay Abhra writes: > +int git_configset_get_string_const(struct config_set *cs, const char *key, > const char **dest) > +{ > + const char *value; > + if (!git_configset_get_value(cs, key, &value)) > + return git_config_string(dest, key, value); > + else > + r

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

2014-07-24 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