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

[PATCH] git-rebase -i: have an option for amending the commit message only.

From
Pierre Habouzit <madcoder@debian.org>
Date
Jun 11, 2008, 15:01 UTC
Message-ID
<1213196490-7762-1-git-send-email-madcoder@debian.org>
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 git-rebase--interactive.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 3f926d8..c1b4260 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -215,6 +215,15 @@ do_next () {
 		pick_one $sha1 ||
 			die_with_patch $sha1 "Could not apply $sha1... $rest"
 		;;
+	comment|c)
+		comment_for_reflog comment
+
+		mark_action_done
+		pick_one $sha1 ||
+			die_with_patch $sha1 "Could not apply $sha1... $rest"
+		output git commit --no-verify --amend -e -C HEAD
+		;;
+
 	edit|e)
 		comment_for_reflog edit
 
@@ -688,6 +697,7 @@ do
 # Commands:
 #  p, pick = use commit
 #  e, edit = use commit, but stop for amending
+#  c, comment = use commit, but stop for changing the commit message
 #  s, squash = use commit, but meld into previous commit
 #  mark :mark = mark the current HEAD for later reference
 #  reset commit = reset HEAD to the commit
-- 
1.5.6.rc2.128.g6656e
Next: Pierre Habouzit
Message 1 of 5 in “git-rebase -i: have an option for amending the commit message only.”
  1. git-rebase -i: have an option for amending the commit message only.Pierre Habouzit, Jun 11, 2008
  2. git-rebase -i: improve help readabilityPierre Habouzit, Jun 11, 2008
  3. Olivier MarinJun 11, 2008
  4. Pierre HabouzitJun 11, 2008
  5. Stephan BeyerJun 11, 2008

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.