Re: [PATCH v9 3/8] add line number and file name info to `config_set`
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 7, 2014, 20:11 UTC
- Message-ID
- <vpqegwsm54s.fsf@anie.imag.fr>
- In-Reply-To
- <xmqqwqakjc43.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 26 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>> ...
>>>> diff --git a/cache.h b/cache.h
>>>> ...
>>>> +struct key_value_info {
>>>> + const char *filename;
>>>> + int linenr;
>>>> +};
>>>> +
>>>
>>> I haven't checked, but does this series now include a user for
>>> this struct outside of config.c? If not, then I think it would
>>> be better to leave the declaration in config.c until it is needed.
>>> (To make it easier to see if it is necessary in the context of the
>>> patch which will make use of it).
>>
>> I disagree: this patch series is essentially about introducing a new
>> API, and this struct declaration is part of the API.
>
> Hmm, is it? How would the customer of the API use it? die_config
> and friends may internally use the information recorded using the
> structure, but I had an impression that it is an implementation
> detail that does not need to be exposed to the customers of the API.
> Am I mistaken?It does if you want to provide error message while iterating over the string_list. Not the common case, but shouldn't be forbidden either.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/