Re: [PATCH 1/4] remote: return non-const pointer from error_buf()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 20, 2026, 00:28 UTC
- Message-ID
- <xmqqikcx3z5x.fsf@gitster.g>
- In-Reply-To
- <aW3QVkpPPHjKVNLC@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 7 quoted lines
> This function signature is indeed quite misleading, and I'd argue that > it continues to be so even after the change. I guess the intent is to > make it a bit easier to print an error in functions that return a > string. > > I'm not really a huge fan of this, but it's not a fault of this patch > series, so let's read on.
I concur. "If they do not return any useful value, they should be void" was my first reaction, but presumably just like "return error("message");" is a handy way to give message while signalling an error to the caller, these are used to return NULL that signals an error? I do not offhand think of a good longer-term direction to improve this one.