git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Ability to edit message from git rebase --interactive.
@ 2009-03-17 18:53 Olivier Goffart
  2009-03-17 22:31 ` Johannes Schindelin
  0 siblings, 1 reply; 16+ messages in thread
From: Olivier Goffart @ 2009-03-17 18:53 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

Hello.

I use git in a workflow in wich we often need to edit the message logs of some 
commits.
The way we do it is using git rebase -i    and choose edit.   
But then you need to do git commit --amend and git rebase --continue,  which 
is error prone and add more useless steps.

The attached patch add a new keyword to git rebase interactive to just edit 
the message log.

I was told on IRC that this has been discussed already not so long ago, and 
looking on the archive[1], all i seen was bikesheeding .  Here is a patch :-)

Do you think it make sens to have that in git?

Please CC me replies.

-- 
Olivier


[1] http://thread.gmane.org/gmane.comp.version-control.git/105738
(my patch is different from this one as it adds a new keyword rather than 
change the behavior of one existing one)


[-- Attachment #2: editmessage.diff --]
[-- Type: text/x-patch, Size: 1158 bytes --]

commit 71793acdd9f926ea52d034b17ac3465e3a810799
Author: Olivier Goffart <ogoffart@kde.org>
Date:   Tue Mar 17 19:41:40 2009 +0100

    rebase interactive: add the possibility to easily edit the message log of commits

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 3dc659d..6ded58e 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -406,6 +406,16 @@ do_next () {
 			die_with_patch $sha1 ""
 		fi
 		;;
+	message|m)
+		comment_for_reflog message
+
+		mark_action_done
+
+		pick_one $sha1 ||
+			die_with_patch $sha1 "Could not apply $sha1... $rest"
+
+		git commit --amend || failed=t
+		;;
 	*)
 		warn "Unknown command: $command $sha1 $rest"
 		die_with_patch $sha1 "Please fix this in the file $TODO."
@@ -730,6 +740,7 @@ first and then run 'git rebase --continue' again."
 #  p, pick = use commit
 #  e, edit = use commit, but stop for amending
 #  s, squash = use commit, but meld into previous commit
+#  m, message = use commit and promt the editor to edit the message log
 #
 # If you remove a line here THAT COMMIT WILL BE LOST.
 # However, if you remove everything, the rebase will be aborted.

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-04-10 19:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-17 18:53 Ability to edit message from git rebase --interactive Olivier Goffart
2009-03-17 22:31 ` Johannes Schindelin
2009-03-18  0:40   ` Jeff King
2009-03-18  0:58     ` Johannes Schindelin
2009-03-18  1:06     ` Junio C Hamano
2009-03-18  5:42       ` Sverre Rabbelier
2009-03-18  9:54         ` Michael J Gruber
2009-03-18 14:52           ` Marcel M. Cary
2009-03-18 21:02             ` Marcel M. Cary
2009-04-10 12:17   ` Olivier Goffart
2009-04-10 12:37     ` Michael Witten
2009-04-10 12:41       ` Michael Witten
2009-04-10 18:21       ` Johannes Schindelin
2009-04-10 18:50         ` Michael Witten
2009-04-10 18:54           ` Sverre Rabbelier
2009-04-10 19:04             ` Michael Witten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).