Re: [PATCH 2/7] rewrite git_config() to use the config-set API
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jul 23, 2014, 19:58 UTC
- Message-ID
- <vpqwqb3u9s6.fsf@anie.imag.fr>
- In-Reply-To
- <1406140978-9472-3-git-send-email-tanayabh@gmail.com>
Tanay Abhra <tanayabh@gmail.com> writes:
Show 12 quoted lines
> +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 ((entry = hashmap_iter_next(&iter))) {
> + strptr = &entry->value_list;
> + for (i = 0; i < strptr->nr; i++) {
> + if (fn(entry->key, strptr->items[i].string, data) < 0)
> + die("bad config file line in (TODO: file/line info)");One more reason to reorder (but that will actually be slightly more than "rebase -i", you'll have a few conflicts to fix) is to avoid this TODO. Put the patch after the line number patch and you'll be able to provide the right information directly.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/