threads / patch / 13897

patchgit-rebase -i: improve help readability

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

## tl;dr

5 messages between Jun 11, 2008 and Jun 11, 2008. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Pierre Habouzit· Jun 11, 2008, 15:01 UTC · lore

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

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 git-rebase--interactive.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
Show changes to git-rebase--interactive.sh +10 −0
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· Jun 11, 2008, 15:01 UTC · re: Pierre Habouzit · lore
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 git-rebase--interactive.sh |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
Show changes to git-rebase--interactive.sh +10 −9
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· Jun 11, 2008, 18:36 UTC · re: Pierre Habouzit · lore

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

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.
Show 6 quoted lines
> +		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· Jun 11, 2008, 22:27 UTC · re: Olivier Marin · lore

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

On Wed, Jun 11, 2008 at 06:36:45PM +0000, Olivier Marin wrote:
Show 9 quoted lines
> 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.
Show 9 quoted lines
> > +		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· Jun 11, 2008, 22:51 UTC · re: Pierre Habouzit · lore

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

Hi,

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

Show 6 quoted lines
> > > +		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

← back to recent threads