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

[PATCH 1/2] rebase -i: run "commit --amend" with verbose if rebase was called with -v

From
Andrew Wong <andrew.kw.w@gmail.com>
Date
Jul 25, 2011, 03:38 UTC
Message-ID
<1311565113-5022-2-git-send-email-andrew.kw.w@gmail.com>
In-Reply-To
<1311565113-5022-1-git-send-email-andrew.kw.w@gmail.com>

This provides a convenient way to inspect the diff while rewording commits, which is really useful when rewording commit messages that are unclear.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
---
 git-rebase--interactive.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index c6ba7c1..df9f7e9 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -392,10 +392,12 @@ do_next () {
 	reword|r)
 		comment_for_reflog reword
 
+		test t = "$verbose" && commit_verbose_flag=--verbose
+
 		mark_action_done
 		pick_one $sha1 ||
 			die_with_patch $sha1 "Could not apply $sha1... $rest"
-		git commit --amend --no-post-rewrite
+		git commit $commit_verbose_flag --amend --no-post-rewrite
 		record_in_rewritten $sha1
 		;;
 	edit|e)
-- 
1.7.2.2
Previous: Andrew WongNext: Andrew Wong
Message 2 of 4 in “rebase -i: Some nice-to-have behaviors for "reword"”
  1. 0/2 rebase -i: Some nice-to-have behaviors for "reword"Andrew Wong, Jul 25, 2011
  2. 1/2 rebase -i: run "commit --amend" with verbose if rebase was called with -vAndrew Wong, Jul 25, 2011
  3. 2/2 rebase -i: interrupt rebase when "commit --amend" failedAndrew Wong, Jul 25, 2011
  4. Sverre RabbelierJul 30, 2011

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.