Re: [PATCH v2 03/13] config: make 'git config list --type=<X>' work
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 17, 2026, 16:11 UTC
- Message-ID
- <xmqqa4x7e4eb.fsf@gitster.g>
- In-Reply-To
- <aZQvLzL-AhPG3rbx@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 12 quoted lines
>> - if (!opts->omit_values && value_)
>> - printf("%s%c%s%c", key_, opts->delim, value_, opts->term);
>> - else
>> - printf("%s%c", key_, opts->term);
>> + if (format_config(opts, &formatted, key_, value_, kvi, 1) >= 0)
>> + fwrite(formatted.buf, 1, formatted.len, stdout);
>
> We could probably use puts(3p) instead, but as we know the length of the
> data ahead of time it might be more efficient to use fwrite(3p) indeed.
> Ultimately I guess it doesn't matter much.
>
> PatrickIf we are not always doing LF-delimited output, puts(3) would not help us very much, I suspect.