Thread (8 messages) flat view 8 messages, 4 authors, 2020-11-18

Re: [PATCH] list-objects-filter-options: fix function name in BUG

From: Jeff King <hidden>
Date: 2020-11-17 02:14:01

On Sat, Nov 14, 2020 at 09:43:26AM +0100, Martin Ågren wrote:
Fix the function name we give in the BUG message. It's "config", not
"choice".
Yep, obviously an improvement.

But as a general rule, I don't think we even need to include function
names here. The message would look like:

  BUG: list-objects-filter-options.c:20: list_object_filter_choice_name: invalid argument '3'

which already tells us where the code is[1]. Perhaps:

  BUG("invalid filter choice enum: %d", c);

would be shorter but equally informative (I don't overly care here,
since the idea is that nobody sees it, but just making a point about the
future).

-Peff

[1] Obviously it doesn't include the actual function name, though we
    could do so on many platforms by using __FUNCTION__. I tend to think
    it would make the messages overly long, but again, the hope is that
    nobody ever sees these.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help