git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-rebase -i: have an option for amending the commit message only.
@ 2008-06-11 15:01 Pierre Habouzit
  2008-06-11 15:01 ` [PATCH] git-rebase -i: improve help readability Pierre Habouzit
  2008-06-11 18:36 ` [PATCH] git-rebase -i: have an option for amending the commit message only Olivier Marin
  0 siblings, 2 replies; 5+ messages in thread
From: Pierre Habouzit @ 2008-06-11 15:01 UTC (permalink / raw)
  To: git; +Cc: gitster, Pierre Habouzit

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

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

* [PATCH] git-rebase -i: improve help readability
  2008-06-11 15:01 [PATCH] git-rebase -i: have an option for amending the commit message only Pierre Habouzit
@ 2008-06-11 15:01 ` Pierre Habouzit
  2008-06-11 18:36 ` [PATCH] git-rebase -i: have an option for amending the commit message only Olivier Marin
  1 sibling, 0 replies; 5+ messages in thread
From: Pierre Habouzit @ 2008-06-11 15:01 UTC (permalink / raw)
  To: git; +Cc: gitster, Pierre Habouzit

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

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

* Re: [PATCH] git-rebase -i: have an option for amending the commit message only.
  2008-06-11 15:01 [PATCH] git-rebase -i: have an option for amending the commit message only Pierre Habouzit
  2008-06-11 15:01 ` [PATCH] git-rebase -i: improve help readability Pierre Habouzit
@ 2008-06-11 18:36 ` Olivier Marin
  2008-06-11 22:27   ` Pierre Habouzit
  1 sibling, 1 reply; 5+ messages in thread
From: Olivier Marin @ 2008-06-11 18:36 UTC (permalink / raw)
  To: Pierre Habouzit; +Cc: git, gitster

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.

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

* Re: [PATCH] git-rebase -i: have an option for amending the commit  message only.
  2008-06-11 18:36 ` [PATCH] git-rebase -i: have an option for amending the commit message only Olivier Marin
@ 2008-06-11 22:27   ` Pierre Habouzit
  2008-06-11 22:51     ` Stephan Beyer
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Habouzit @ 2008-06-11 22:27 UTC (permalink / raw)
  To: Olivier Marin; +Cc: git, gitster

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

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

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH] git-rebase -i: have an option for amending the commit message only.
  2008-06-11 22:27   ` Pierre Habouzit
@ 2008-06-11 22:51     ` Stephan Beyer
  0 siblings, 0 replies; 5+ messages in thread
From: Stephan Beyer @ 2008-06-11 22:51 UTC (permalink / raw)
  To: Pierre Habouzit
  Cc: Olivier Marin, git, gitster, Daniel Barkalow, Christian Couder

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

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2008-06-11 22:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-11 15:01 [PATCH] git-rebase -i: have an option for amending the commit message only Pierre Habouzit
2008-06-11 15:01 ` [PATCH] git-rebase -i: improve help readability Pierre Habouzit
2008-06-11 18:36 ` [PATCH] git-rebase -i: have an option for amending the commit message only Olivier Marin
2008-06-11 22:27   ` Pierre Habouzit
2008-06-11 22:51     ` Stephan Beyer

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).