From: Junio C Hamano Date: Thu, 12 Feb 2026 22:26:46 GMT Subject: Re: [PATCH 2/4] builtin/history: check for merges before asking for user input Message-ID: In-Reply-To: "D. Ben Knoble" writes: > On Thu, Feb 12, 2026 at 7:45 AM Patrick Steinhardt wrote: >> >> The replay infrastructure is not yet capable of replaying merge commits. >> Unfortunately, we only notice that we're about to replay merges after we >> have already asked the user for input, so any commit message that the >> user may have written will be discarded in that case. >> >> Fix this by checking whether the revwalk contains merge commits before >> we ask for user input. > > Indeed, that would be irritating :) > >> >> Signed-off-by: Patrick Steinhardt >> --- >> builtin/history.c | 40 ++++++++++++++++++++++++++++++++++++++++ >> t/t3451-history-reword.sh | 2 +- >> 2 files changed, 41 insertions(+), 1 deletion(-) >> >> diff --git a/builtin/history.c b/builtin/history.c >> index 1de51372ea..ca0cdb6a58 100644 >> --- a/builtin/history.c >> +++ b/builtin/history.c >> @@ -177,6 +177,42 @@ static int parse_ref_action(const struct option *opt, const char *value, int uns >> return 0; >> } >> >> +static int revwalk_contains_merges(struct repository *repo, >> + const struct strvec *revwalk_args) >> +{ >> + struct strvec args = STRVEC_INIT; >> + struct rev_info revs; >> + int ret; >> + >> + for (size_t i = 0; i < revwalk_args->nr; i++) >> + strvec_push(&args, revwalk_args->v[i]); > > I'm surprised we don't have anything like Rust's Vec::append or > Vec::extend_from_slice strvec_pushv() is what you are looking for.