From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
git@vger.kernel.org, hanwen@google.com
Subject: Re: [PATCH 3/3] fixup! reftable: add a heap-based priority queue for reftable records
Date: Thu, 02 Sep 2021 21:42:02 -0700 [thread overview]
Message-ID: <xmqqbl5agtid.fsf@gitster.g> (raw)
In-Reply-To: <YTFS2oQz9QEzBe0Q@coredump.intra.peff.net> (Jeff King's message of "Thu, 2 Sep 2021 18:40:26 -0400")
Jeff King <peff@peff.net> writes:
>> I agree that the patch as posted does not help but if this is
>> originally an assertion, then it should never trigger in real life,
>> so BUG() would be more appropriate than an error return, no?
>
> My thinking was that it doesn't make much sense as an assertion in the
> first place. It is not a side effect of "let's make sure things are as
> we expect while we're doing some other operation". The whole point of
> the function is: is this data structure properly in order.
Very true. Ah, so you mean the way this function is supposed to be
used is to _call_ it, like so:
if (!is_our_data_structure_healthy())
BUG(...);
It makes it easier to reason about what the function is doing, I
guess.
> But I guess you could argue that calling the function is itself a form
> of assertion. I don't really care that much either way, so whatever
> Han-Wen prefers is fine with me (but I do think it is worth addressing
> the warning Carlo found _somehow_).
>
> -Peff
prev parent reply other threads:[~2021-09-03 4:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 5:30 [PATCH 0/3] hn/reftable: fixes for building with -DNDEBUG Carlo Marcelo Arenas Belón
2021-09-02 5:30 ` [PATCH 1/3] fixup! refs: RFC: Reftable support for git-core Carlo Marcelo Arenas Belón
2021-09-02 9:05 ` Jeff King
2021-09-02 9:26 ` Han-Wen Nienhuys
2021-09-02 5:30 ` [PATCH 2/3] fixup! reftable: add merged table view Carlo Marcelo Arenas Belón
2021-09-02 5:30 ` [PATCH 3/3] fixup! reftable: add a heap-based priority queue for reftable records Carlo Marcelo Arenas Belón
2021-09-02 9:09 ` Jeff King
2021-09-02 20:08 ` Junio C Hamano
2021-09-02 22:40 ` Jeff King
2021-09-03 4:42 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqbl5agtid.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=carenas@gmail.com \
--cc=git@vger.kernel.org \
--cc=hanwen@google.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).