From: "Lidong Yan via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Phillip Wood <phillip.wood123@gmail.com>,
Lidong Yan <502024330056@smail.nju.edu.cn>
Subject: [PATCH v4 0/2] sequencer: replace error() with BUG() in update_squash_messages()
Date: Tue, 03 Jun 2025 02:01:12 +0000 [thread overview]
Message-ID: <pull.1964.v4.git.git.1748916074.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1964.v3.git.git.1748569955.gitgitgadget@gmail.com>
Lidong Yan (2):
sequencer: replace error() with BUG() in update_squash_messages()
BUG(): remove leading underscore of the format string
builtin/mktag.c | 2 +-
builtin/worktree.c | 2 +-
pack-bitmap-write.c | 2 +-
sequencer.c | 6 ++++--
4 files changed, 7 insertions(+), 5 deletions(-)
base-commit: fcfe60668e05ffde2610bfef9045797618c145ac
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1964%2Fbrandb97%2Ffix-sequencer-leak-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1964/brandb97/fix-sequencer-leak-v4
Pull-Request: https://github.com/git/git/pull/1964
Range-diff vs v3:
1: b812f973d18 ! 1: f2d2cfd6a87 sequencer: replace error() with BUG() in update_squash_messages()
@@ Commit message
In sequencer.c, caller only pass TODO_SQUASH or TODO_FIXUP to
update_squash_messages(), any other command passed in should be
- considered as BUG. Thus I think `return error('unknown command')`
- should be replaced as `BUG('unknown command')`.
+ considered as BUG. Replace `return error('unknown command')`
+ with `BUG('not a FIXUP or SQUASH')`.
Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
@@ sequencer.c: static int update_squash_messages(struct repository *r,
const char *encoding = get_commit_output_encoding();
+ if (!is_fixup(command))
-+ BUG("unknown command: %d", command);
++ BUG("not a FIXUP or SQUASH %d", command);
+
if (ctx->current_fixup_count > 0) {
struct strbuf header = STRBUF_INIT;
2: e1f84c111f6 ! 2: 9d69c19273b BUG(): remove leading underscore of the format string
@@ Commit message
BUG(): remove leading underscore of the format string
BUG() is not end-user facing but programmer facing, and we do not
- use _("...") in them. I searched all `BUG(_` pattern and replace
- them with `BUG(`
+ use _("...") in them. Replace all `BUG(_("..."))` with `BUG("...")`
Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
--
gitgitgadget
next prev parent reply other threads:[~2025-06-03 2:01 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 ` Lidong Yan via GitGitGadget [this message]
2025-06-03 2:01 ` [PATCH v4 1/2] sequencer: replace error() with BUG() in update_squash_messages() 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
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=pull.1964.v4.git.git.1748916074.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=502024330056@smail.nju.edu.cn \
--cc=git@vger.kernel.org \
--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 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).