git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] fixup! reftable: add a heap-based priority queue for reftable records

From
Jeff King <peff@peff.net>
Date
Sep 2, 2021, 22:40 UTC
Message-ID
<YTFS2oQz9QEzBe0Q@coredump.intra.peff.net>
In-Reply-To
<xmqqeea6kaed.fsf@gitster.g>
On Thu, Sep 02, 2021 at 01:08:58PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> > This will trigger -Wunused-parameter warnings, since the function body
> > is now empty when NDEBUG is undefined. Probably switching the assert()
> > to die() would be better, since the whole point of the function is just
> > to exit on error.
> >
> > If there's a problem using die() from the reftable code, it could also
> > return an error and the caller in the test helper could propagate it.
> 
> 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.

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 10 in “hn/reftable: fixes for building with -DNDEBUG”
  1. 0/3 hn/reftable: fixes for building with -DNDEBUGCarlo Marcelo Arenas Belón, Sep 2, 2021
  2. 1/3 fixup! refs: RFC: Reftable support for git-coreCarlo Marcelo Arenas Belón, Sep 2, 2021
  3. Jeff KingSep 2, 2021
  4. Han-Wen NienhuysSep 2, 2021
  5. 2/3 fixup! reftable: add merged table viewCarlo Marcelo Arenas Belón, Sep 2, 2021
  6. 3/3 fixup! reftable: add a heap-based priority queue for reftable recordsCarlo Marcelo Arenas Belón, Sep 2, 2021
  7. Jeff KingSep 2, 2021
  8. Junio C HamanoSep 2, 2021
  9. Jeff KingSep 2, 2021
  10. Junio C HamanoSep 3, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.