Re: [PATCH v4 3/6] rewrite git_config() to use the config-set API

2014-07-29 Thread Tanay Abhra
On 7/29/2014 7:33 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> On 7/29/2014 6:10 PM, Matthieu Moy wrote: >>> So, I think it's time to make it official that git_config() does not >>> return an error code, and make it return void. I would do that in a >>> patch before the git_config() -> gi

Re: [PATCH v4 3/6] rewrite git_config() to use the config-set API

2014-07-29 Thread Matthieu Moy
Tanay Abhra writes: > On 7/29/2014 6:10 PM, Matthieu Moy wrote: >> So, I think it's time to make it official that git_config() does not >> return an error code, and make it return void. I would do that in a >> patch before the git_config() -> git_config_raw() rewrite. >> >> My preference would b

Re: [PATCH v4 3/6] rewrite git_config() to use the config-set API

2014-07-29 Thread Tanay Abhra
On 7/29/2014 6:10 PM, Matthieu Moy wrote: > Tanay Abhra writes: > > configset_iter unconditionnally returns 0 (or it dies). Since it is more > or less the equivalent of the old git_config(), I understand why we > never encounter the situation where git_config() would return -1 (syntax > error,

Re: [PATCH v4 3/6] rewrite git_config() to use the config-set API

2014-07-29 Thread Matthieu Moy
Tanay Abhra writes: > +static int configset_iter(struct config_set *cs, config_fn_t fn, void *data) > +{ > + int i, value_index; > + struct string_list *values; > + struct config_set_element *entry; > + struct configset_list *list = &cs->list; > + struct key_value_info *kv_inf

Re: [PATCH v4 3/6] rewrite git_config() to use the config-set API

2014-07-29 Thread Matthieu Moy
Tanay Abhra writes: >> diff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh >> index cd04543..741e080 100755 >> --- a/t/t4055-diff-context.sh >> +++ b/t/t4055-diff-context.sh >> @@ -79,7 +79,7 @@ test_expect_success 'non-integer config parsing' ' >> test_expect_success 'negative intege

Re: [PATCH v4 3/6] rewrite git_config() to use the config-set API

2014-07-29 Thread Tanay Abhra
> diff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh > index cd04543..741e080 100755 > --- a/t/t4055-diff-context.sh > +++ b/t/t4055-diff-context.sh > @@ -79,7 +79,7 @@ test_expect_success 'non-integer config parsing' ' > test_expect_success 'negative integer config parsing' ' >

[PATCH v4 3/6] rewrite git_config() to use the config-set API

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