Re: [PATCH 09/10] trailer: move arg handling to interpret-trailers.c
- From
- Linus Arver <linusa@google.com>
- Date
- Jan 20, 2024, 20:14 UTC
- Message-ID
- <owlyfryrhid8.fsf@fine.c.googlers.com>
- In-Reply-To
- <xmqqo7dim8dz.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 21 quoted lines
> "Linus Arver via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> diff --git a/trailer.c b/trailer.c
>> index e2d541372a3..0a86e0d5afa 100644
>> --- a/trailer.c
>> +++ b/trailer.c
>> @@ -66,6 +66,11 @@ static LIST_HEAD(conf_head);
>>
>> static char *separators = ":";
>>
>> +const char *default_separators(void)
>> +{
>> + return separators;
>> +}
>
> This allows API users to peek into the current set of separator
> bytes (either the default ":" or specified by the configuration
> varaible "trailer.separators"), which is an improvement over
> directly exposing the "separators" variable, but in a longer term,
> do we need to have some "trailer context" object that holds this
> and possibly other global variables like this?Yes, and I've implemented a "trailer_subsystem_conf" struct to hold all configuration-related bits (and hardcoded defaults) relating to trailers in one place, in the larger series.
> I do not demand such further abstraction in this series, but I'd > prefer to see if we all have shared vision into the future.
Makes sense. Thanks.