Re: [PATCH v2 1/2] format-patch: add ability to use alt cover format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 25, 2026, 00:29 UTC
- Message-ID
- <xmqqo6ldd5sa.fsf@gitster.g>
- In-Reply-To
- <aZ4v6p_oKCayr9A7@exploit>
Mirko Faina <mroik@delayed.space> writes:
Show 10 quoted lines
>> > + fprintf(cover_file, "%s\n", commit_line.buf); >> >> I somehow would have expected that as we internally prepare "format" >> string given to this function , we ensure it ends with "\n" so we do >> not have to do a fprintf() here. > > The value of format is user defined, I'm not doing any pre proccessing > to it apart from stripping the prefix. Would it be much different had I > appended a newline here? I personally think it's fine doing a fprintf > here.
I thought you are stripping the prefix and making a copy in the configuration parser. I didn't look closely but I thought it would be trivially cheap to also append LF there. If not, I agree with you that it is not a huge deal to do the "%s\n" here instead.
Thanks for working on this topic.