From: Junio C Hamano <gitster@pobox.com>
To: "Lidong Yan via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Phillip Wood <phillip.wood123@gmail.com>,
Lidong Yan <502024330056@smail.nju.edu.cn>
Subject: Re: [PATCH v4 2/2] BUG(): remove leading underscore of the format string
Date: Tue, 03 Jun 2025 10:40:00 -0700 [thread overview]
Message-ID: <xmqqcybklo5r.fsf@gitster.g> (raw)
In-Reply-To: <9d69c19273be31135eade258b49582bcc6df27c7.1748916074.git.gitgitgadget@gmail.com> (Lidong Yan via GitGitGadget's message of "Tue, 03 Jun 2025 02:01:14 +0000")
"Lidong Yan via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Lidong Yan <502024330056@smail.nju.edu.cn>
>
> BUG() is not end-user facing but programmer facing, and we do not
> use _("...") in them. Replace all `BUG(_("..."))` with `BUG("...")`
>
> Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
> ---
> builtin/mktag.c | 2 +-
> builtin/worktree.c | 2 +-
> pack-bitmap-write.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
This is unrelated to the sequencer code clarification change, so
I'll queue [1/2] and [2/2] as separate topics.
Thanks.
> diff --git a/builtin/mktag.c b/builtin/mktag.c
> index 7ac11c46d53f..1b1dc0263e18 100644
> --- a/builtin/mktag.c
> +++ b/builtin/mktag.c
> @@ -41,7 +41,7 @@ static int mktag_fsck_error_func(struct fsck_options *o UNUSED,
> fprintf_ln(stderr, _("error: tag input does not pass fsck: %s"), message);
> return 1;
> default:
> - BUG(_("%d (FSCK_IGNORE?) should never trigger this callback"),
> + BUG("%d (FSCK_IGNORE?) should never trigger this callback",
> msg_type);
> }
> }
> diff --git a/builtin/worktree.c b/builtin/worktree.c
> index 88a36ea9f867..2dceeeed8bd0 100644
> --- a/builtin/worktree.c
> +++ b/builtin/worktree.c
> @@ -621,7 +621,7 @@ static void print_preparing_worktree_line(int detach,
> else {
> struct commit *commit = lookup_commit_reference_by_name(branch);
> if (!commit)
> - BUG(_("unreachable: invalid reference: %s"), branch);
> + BUG("unreachable: invalid reference: %s", branch);
> fprintf_ln(stderr, _("Preparing worktree (detached HEAD %s)"),
> repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
> }
> diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
> index 7f400ee01213..56960e6ad760 100644
> --- a/pack-bitmap-write.c
> +++ b/pack-bitmap-write.c
> @@ -1087,7 +1087,7 @@ void bitmap_writer_finish(struct bitmap_writer *writer,
> oid_access);
>
> if (commit_pos < 0)
> - BUG(_("trying to write commit not in index"));
> + BUG("trying to write commit not in index");
> stored->commit_pos = commit_pos + base_objects;
> }
prev parent reply other threads:[~2025-06-03 17:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 12:44 [PATCH] sequencer: fix memory leak if `update_squash_messages()` failed Lidong Yan via GitGitGadget
2025-05-15 10:08 ` Phillip Wood
2025-05-15 16:20 ` Junio C Hamano
2025-05-15 16:43 ` lidongyan
2025-05-25 10:19 ` [PATCH v2] sequencer: replace error() with BUG() in update_squash_messages() Lidong Yan via GitGitGadget
2025-05-28 22:16 ` Junio C Hamano
2025-05-29 13:39 ` Phillip Wood
2025-05-30 4:29 ` Junio C Hamano
2025-06-02 13:59 ` Phillip Wood
2025-05-30 1:52 ` [PATCH v3 0/2] " Lidong Yan via GitGitGadget
2025-05-30 1:52 ` [PATCH v3 1/2] " Lidong Yan via GitGitGadget
2025-05-30 13:35 ` Junio C Hamano
2025-05-30 1:52 ` [PATCH v3 2/2] BUG(): remove leading underscore of the format string Lidong Yan via GitGitGadget
2025-05-30 13:15 ` Junio C Hamano
2025-06-03 2:01 ` [PATCH v4 0/2] sequencer: replace error() with BUG() in update_squash_messages() Lidong Yan via GitGitGadget
2025-06-03 2:01 ` [PATCH v4 1/2] " Lidong Yan via GitGitGadget
2025-06-03 2:01 ` [PATCH v4 2/2] BUG(): remove leading underscore of the format string Lidong Yan via GitGitGadget
2025-06-03 17:40 ` 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=xmqqcybklo5r.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=502024330056@smail.nju.edu.cn \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=phillip.wood123@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.