Re: [PATCH v2 04/11] reftable/writer: improve error when passed an invalid block size
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 10, 2024, 21:25 UTC
- Message-ID
- <xmqqo79d2wc7.fsf@gitster.g>
- In-Reply-To
- <5e7cbb7b193c578f7c946a5077a79421b0ac57f2.1715336798.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 6 quoted lines
> The reftable format only supports block sizes up to 16MB. When the > writer is being passed a value bigger than that it simply calls > abort(3P), which isn't all that helpful due to the lack of a proper > error message. > > Improve this by calling `BUG()` instead.
As a "git" person, I do not mind this at all.
But doesn't the reftable/ library codebase want to avoid things like BUG() that are very much tied to our codebase, for the same reason as it avoids things like xmalloc(), xcalloc(), and ALLOC_GROW()?
We may have crossed the bridge long time ago, though. We see a handful calls to BUG() already inside reftable/ directory.