Re: [PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Matthieu Moy
Junio C Hamano writes: >> +int git_config(config_fn_t fn, void *data) >> +{ >> +git_config_check_init(); >> +return configset_iter(&the_config_set, fn, data); >> +} > > Perhaps if you define this function at the right place in the file > you do not have to add an forward decl of git_confi

Re: [PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Junio C Hamano
Tanay Abhra writes: > Of all the functions in `git_config*()` family, `git_config()` has the > most invocations in the whole code base. Each `git_config()` invocation > causes config file rereads which can be avoided using the config-set API. > > Use the config-set API to rewrite `git_config()` t

Re: [PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Matthieu Moy
Tanay Abhra writes: > +static int configset_iter(struct config_set *cs, config_fn_t fn, void *data) > +{ > + int i; > + struct string_list *strptr; > + struct config_set_element *entry; > + struct hashmap_iter iter; > + hashmap_iter_init(&cs->config_hash, &iter); > + while

Re: [PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Matthieu Moy
Tanay Abhra writes: > -int git_config(config_fn_t fn, void *data) > +static int git_config_raw(config_fn_t fn, void *data) As you noticed already, this change breaks several tests. You are going to repair them later in the series, but your patch series produces a non-bisectable history. The his

[PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Tanay Abhra
Of all the functions in `git_config*()` family, `git_config()` has the most invocations in the whole code base. Each `git_config()` invocation causes config file rereads which can be avoided using the config-set API. Use the config-set API to rewrite `git_config()` to use the config caching layer