Re: [PATCH 2/4] refs: trim newline from reflog message
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 24, 2021, 20:55 UTC
- Message-ID
- <xmqqtug1z32j.fsf@gitster.g>
- In-Reply-To
- <CAFQ2z_PqgwYy+RxQm7d7WDQYvQQ2vVE0cXHdDKNwQJm3Xc+NFw@mail.gmail.com>
Han-Wen Nienhuys <hanwen@google.com> writes:
Show 12 quoted lines
>> Ah, perhaps our confusion comes from the fact that I view the ref >> API as a whole and do not draw a fine line of distinction between >> the "ref API implementation common across backends" vs "what ref >> files backend does". But as the implementor of one backend, you >> obviously have to care. > > Having the read function return something different than what the > write gets still seems odd to me. > How about having copy_reflog_msg() trim trailing space and then always add LF? > > The files backend can assert that the string ends in LF, and doesn't > need to add LF itself.
Ehh, let's step back a bit.
Is there anything in the common part and files backend in ref API that needs to be changed to fix some bug? I do not see anything broken that needs to be fixed by "assert that the string ends in LF and doesn't need to add LF itself" or by "always add LF".