# [PATCH] git-rebase -i: improve help readability

5 messages from 2008-06-11 to 2008-06-11. Participants: Pierre Habouzit, Olivier Marin, Stephan Beyer.
Thread: https://gitlist.dev/t/13897

## Pierre Habouzit, 2008-06-11 15:01

Subject: [PATCH] git-rebase -i: have an option for amending the commit message only.
Message-ID: <1213196490-7762-1-git-send-email-madcoder@debian.org>
URL: https://gitlist.dev/e/1213196490-7762-1-git-send-email-madcoder%40debian.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

```

## Pierre Habouzit, 2008-06-11 15:01

Subject: [PATCH] git-rebase -i: improve help readability
Message-ID: <1213196490-7762-2-git-send-email-madcoder@debian.org>
URL: https://gitlist.dev/e/1213196490-7762-2-git-send-email-madcoder%40debian.org
In-Reply-To: <1213196490-7762-1-git-send-email-madcoder@debian.org>

```
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 git-rebase--interactive.sh |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index c1b4260..a3c5488 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -695,15 +695,16 @@ do
 # to a commit previously marked with the 'mark' insn.
 #
 # 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
-#  merge commit-M commit-P ... = redo merge commit-M with the
-#         current HEAD and the parents commit-P
-#  tag = reset tag to the current HEAD
+#  p, pick         use commit
+#  e, edit         use commit, but stop for amending
+#  c, comment      use commit, but update the commit message on the way
+#  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
+#  merge commit-M commit-P
+#                  redo merge commit-M with the current HEAD
+#                  and the parents commit-P
+#  tag             reset tag to the current HEAD
 #
 # If you remove a line here THAT COMMIT WILL BE LOST.
 # However, if you remove everything, the rebase will be aborted.
-- 
1.5.6.rc2.128.g6656e

```

## Olivier Marin, 2008-06-11 18:36

Subject: Re: [PATCH] git-rebase -i: have an option for amending the commit message only.
Message-ID: <48501B3D.3000405@free.fr>
URL: https://gitlist.dev/e/48501B3D.3000405%40free.fr
In-Reply-To: <1213196490-7762-1-git-send-email-madcoder@debian.org>

```
Hi,

I like the feature and I have just two comments:

Pierre Habouzit a écrit :
>
> +	comment|c)

Is "comment" the right name? I'm not sure, I just ask.

> +		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

It does not work with an editor that opens in the current terminal
like vi. Just remove "output" should fix the problem, I think.

Olivier.

```

## Pierre Habouzit, 2008-06-11 22:27

Subject: Re: [PATCH] git-rebase -i: have an option for amending the commit message only.
Message-ID: <20080611222744.GD16439@artemis.madism.org>
URL: https://gitlist.dev/e/20080611222744.GD16439%40artemis.madism.org
In-Reply-To: <48501B3D.3000405@free.fr>

```
On Wed, Jun 11, 2008 at 06:36:45PM +0000, Olivier Marin wrote:
> Hi,
> 
> I like the feature and I have just two comments:
> 
> Pierre Habouzit a écrit :
> >
> > +	comment|c)
> 
> Is "comment" the right name? I'm not sure, I just ask.

  Well, edit would have been better, but it's taken already. 'message'
has m as a shortcut, already taken by merge, so 'comment' felt like the
best I could come up with.

  To be fair, if someone has a better name, I'm all for it. I quite care
about the feature, edit needs me to run the --amend myself, whereas I
often just want to fix a typo in a commit log.

> > +		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
> 
> It does not work with an editor that opens in the current terminal
> like vi. Just remove "output" should fix the problem, I think.

  I'm surprised because I used it this way, but maybe it was on the
machine where my git editor is gvim and not vim …

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

```

## Stephan Beyer, 2008-06-11 22:51

Subject: Re: [PATCH] git-rebase -i: have an option for amending the commit message only.
Message-ID: <20080611225107.GB7200@leksak.fem-net>
URL: https://gitlist.dev/e/20080611225107.GB7200%40leksak.fem-net
In-Reply-To: <20080611222744.GD16439@artemis.madism.org>

```
Hi,

I want to add a quick note as the one who is currently responsible for
future git-sequencer ;-)

> > > +		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

I dislike that "comment" does a pick.
Well, your version is consistent with the rest of rebase-i, but 
inconsistent to the more atomic and general approach of the
git-sequencer thread.

You use
	comment deadf00
instead of
	pick deadf00
Would you mind if you had to use something like this:
	pick deadf00
	comment
to reedit the message of deadf00?

The difference for you as vim user is that you won't type "<Home> c w comment",
but "o comment" :-)
The outcome is that you can also use it for patches, not only for
cherry-picks ;)

>   To be fair, if someone has a better name, I'm all for it.

What about "amend"? :)
...or "amend-message" or something like this.

> I quite care about the feature, edit needs me to run the --amend myself,
> whereas I often just want to fix a typo in a commit log.

I understand ;)

Well, I like to add it to the sequencer spec and to the prototype as soon 
as the name is clear ;-)

Regards,
  Stephan

-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F

```
