From: Junio C Hamano Date: Mon, 08 Jun 2026 12:16:33 GMT Subject: Re: [PATCH RFC 2/2] builtin/history: print feedback after successful reword Message-ID: In-Reply-To: <20260607-ps-history-reword-v1-2-ba43a3cbb81b@gmail.com> Pablo Sabater writes: > Unlike `git commit --amend` and `git rebase -i`, `git history reword` > doesn't print anything, this makes it feel empty for a porcelain command > and hard to tell if the command did anything without using other > commands like `git log ` to check if the reword was done. > > Print a message on successful rewords so the user has feedback about it. > > Signed-off-by: Pablo Sabater > --- > builtin/history.c | 4 ++++ > t/t3451-history-reword.sh | 14 ++++++++++++++ > 2 files changed, 18 insertions(+) > > diff --git a/builtin/history.c b/builtin/history.c > index 51a22a9a1c..0f1ba3b531 100644 > --- a/builtin/history.c > +++ b/builtin/history.c > @@ -739,6 +739,10 @@ static int cmd_history_reword(int argc, > goto out; > } > > + fprintf(stderr, _("Successfully reworded commit %s to %s\n"), > + repo_find_unique_abbrev(repo, &original->object.oid, DEFAULT_ABBREV), > + repo_find_unique_abbrev(repo, &rewritten->object.oid, DEFAULT_ABBREV)); > + > ret = 0; > > out: Do other commands in "git history" (split is in 'master', drop and fixup are cooking) behave with similar verbosity? Consistency within the same "history" umbrella matters more than being similar with other commands that can be used for similar purposes. > diff --git a/t/t3451-history-reword.sh b/t/t3451-history-reword.sh > index 54ea8a7207..4b22d761e3 100755 > --- a/t/t3451-history-reword.sh > +++ b/t/t3451-history-reword.sh > @@ -416,4 +416,18 @@ test_expect_success 'aborts if the commit message is the same' ' > ) > ' > > +test_expect_success 'prints feedback on successful reword' ' > + test_when_finished "rm -rf repo" && > + git init repo && > + ( > + cd repo && > + test_commit first && > + > + reword_with_message HEAD 2>err <<-EOF && > + first reworded > + EOF > + test_grep "Successfully reworded" err > + ) > +' > + > test_done