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

2014-07-24 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com 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

[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

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

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com 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

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

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com 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); +

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

2014-07-23 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com 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