From: Jeff King <peff@peff.net>
To: "Martin Ågren" <martin.agren@gmail.com>
Cc: git@vger.kernel.org, Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH] list-objects-filter-options: fix function name in BUG
Date: Mon, 16 Nov 2020 21:13:18 -0500 [thread overview]
Message-ID: <20201117021318.GA30463@coredump.intra.peff.net> (raw)
In-Reply-To: <20201114084327.14891-1-martin.agren@gmail.com>
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.
next prev parent reply other threads:[~2020-11-17 2:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-14 8:43 [PATCH] list-objects-filter-options: fix function name in BUG Martin Ågren
2020-11-17 2:13 ` Jeff King [this message]
2020-11-17 18:02 ` Martin Ågren
2020-11-17 22:54 ` Jeff King
2020-11-17 23:07 ` Eric Sunshine
2020-11-18 2:08 ` Jeff King
2020-11-18 2:24 ` Jonathan Nieder
2020-11-18 6:22 ` Martin Ågren
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201117021318.GA30463@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=martin.agren@gmail.com \
--cc=me@ttaylorr.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).