Re: [PATCH v3 5/6] config: add `git_die_config()` to the config-set API

2014-07-28 Thread Matthieu Moy
Tanay Abhra writes: > On 7/28/2014 4:25 PM, Ramsay Jones wrote: >> On 28/07/14 11:33, Tanay Abhra wrote: >>> + if (!kv_info->linenr) >>> + die("unable to parse command-line config"); >>> + else >>> + die("bad config file line %d in %s",kv_info->linenr, >>> kv_info->filena

Re: [PATCH v3 5/6] config: add `git_die_config()` to the config-set API

2014-07-28 Thread Matthieu Moy
Tanay Abhra writes: > +void git_die_config(const char *key) > +{ > + const struct string_list *values; > + struct key_value_info *kv_info; > + values = git_config_get_value_multi(key); > + kv_info = values->items[values->nr - 1].util; > + if (!kv_info->linenr) > +

Re: [PATCH v3 5/6] config: add `git_die_config()` to the config-set API

2014-07-28 Thread Tanay Abhra
On 7/28/2014 4:25 PM, Ramsay Jones wrote: > On 28/07/14 11:33, Tanay Abhra wrote: >> Add `git_die_config` that dies printing the line number and the file name >> of the highest priority value for the configuration variable `key`. >> >> It has usage in non-callback based config value retrieval where

Re: [PATCH v3 5/6] config: add `git_die_config()` to the config-set API

2014-07-28 Thread Ramsay Jones
On 28/07/14 11:33, Tanay Abhra wrote: > Add `git_die_config` that dies printing the line number and the file name > of the highest priority value for the configuration variable `key`. > > It has usage in non-callback based config value retrieval where we can > raise an error and die if there is a

[PATCH v3 5/6] config: add `git_die_config()` to the config-set API

2014-07-28 Thread Tanay Abhra
Add `git_die_config` that dies printing the line number and the file name of the highest priority value for the configuration variable `key`. It has usage in non-callback based config value retrieval where we can raise an error and die if there is a semantic error. For example, if (!git_c