git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH RFC 2/2] builtin/history: print feedback after successful reword

From
Patrick Steinhardt <ps@pks.im>
Date
Jun 8, 2026, 09:30 UTC
Message-ID
<aiaLyQvo8kqfv4js@pks.im>
In-Reply-To
<20260607-ps-history-reword-v1-2-ba43a3cbb81b@gmail.com>
On Sun, Jun 07, 2026 at 10:07:21PM +0200, Pablo Sabater wrote:
Show 6 quoted lines
> 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 <commit>` to check if the reword was done.
> 
> Print a message on successful rewords so the user has feedback about it.

I dunno about this one. My take here is that a command should be silent unless it has something to say, for example when it couldn't honor the user's request [1].

Show 12 quoted lines
> 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));
> +
Seeing the implementation also raises a couple of questions:
  - Why do we mention the rewritten commit, only? Shouldn't we also
    print the changed HEAD?
  - Why don't we print any of the other rewritten branches?
  - What makes "git history reword" so special as compared to for
    example "git history fixup" or "git history split" so that it needs
    a message while the others don't?

It might make sense to maybe introduce a verbose mode where we do print such information. But if so, we should have good answers to the above questions and implement this in a way that makes sense for the other subcommands, too, so that we can apply the same principle to all of them.

Thanks!
Patrick
[1]: https://www.linfo.org/rule_of_silence.html
Previous: Pablo SabaterNext: Pablo Sabater
Message 15 of 36 in “builtin/history: change git history reword behavior and feedback”
  1. 0/2 builtin/history: change git history reword behavior and feedbackPablo Sabater, Jun 7, 2026
  2. 1/2 builtin/history: abort reword on unchanged messagePablo Sabater, Jun 7, 2026
  3. Patrick SteinhardtJun 8, 2026
  4. Pablo SabaterJun 8, 2026
  5. Junio C HamanoJun 8, 2026
  6. Ben KnobleJun 8, 2026
  7. Pablo SabaterJun 9, 2026
  8. Pablo SabaterJun 9, 2026
  9. Kristoffer HaugsbakkJun 9, 2026
  10. Junio C HamanoJun 9, 2026
  11. Pablo SabaterJun 9, 2026
  12. Ben KnobleJun 8, 2026
  13. Pablo SabaterJun 9, 2026
  14. 2/2 builtin/history: print feedback after successful rewordPablo Sabater, Jun 7, 2026
  15. Patrick SteinhardtJun 8, 2026
  16. Pablo SabaterJun 8, 2026
  17. Junio C HamanoJun 8, 2026
  18. Pablo SabaterJun 8, 2026
  19. Ben KnobleJun 8, 2026
  20. Dominique MartinetJul 7, 2026
  21. D. Ben KnobleJul 7, 2026
  22. Patrick SteinhardtJul 8, 2026
  23. 0/2 builtin/history: abort reword on same messagePablo Sabater, Jun 9, 2026
  24. 1/2 builtin/history: refactor function signaturePablo Sabater, Jun 9, 2026
  25. 2/2 builtin/history: abort reword on same messagePablo Sabater, Jun 9, 2026
  26. Phillip WoodJun 9, 2026
  27. Junio C HamanoJun 9, 2026
  28. Pablo SabaterJun 9, 2026
  29. Junio C HamanoJun 9, 2026
  30. Patrick SteinhardtJun 10, 2026
  31. Phillip WoodJun 10, 2026
  32. Junio C HamanoJun 10, 2026
  33. Justin ToblerJun 9, 2026
  34. Junio C HamanoJun 9, 2026
  35. Justin ToblerJun 9, 2026
  36. Phillip WoodJun 10, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.