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

[PATCH v2] rebase -i: support single-letter abbreviations for the actions

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 29, 2007, 02:32 UTC
Message-ID
<Pine.LNX.4.64.0709290323560.28395@racer.site>
In-Reply-To
<7vfy0ymd7g.fsf@gitster.siamese.dyndns.org>

When you do many rebases, you can get annoyed by having to type out the actions "edit" or "squash" in total.

This commit helps that, by allowing you to enter "e" instead of "edit", "p" instead of "pick", or "s" instead of "squash".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	On Fri, 28 Sep 2007, Junio C Hamano wrote:
	> I am not sure if we want to taint the words merge and amend like
	> this.  I was hoping someday you would allow people to reorder
	> something like this...
	Okay, you convinced me.
	> 
	>           e
	>            \     
	>  ---a---b---c---d
	> 
	> into something like this:
	> 
	>       e
	>        \     
	>  ---b'--c'--a'+d'
	I thought that this would be possible with "git rebase -p -i"?
	Ah no, that does not work; "-p" is not yet graceful enough to 
	accept reorders.  (But then, I do not see why the command should 
	be "merge" instead of the "pick" we already have...)
 git-rebase--interactive.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 823291d..7a5aaa5 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -232,14 +232,14 @@ do_next () {
 	'#'*|'')
 		mark_action_done
 		;;
-	pick)
+	pick|p)
 		comment_for_reflog pick
 
 		mark_action_done
 		pick_one $sha1 ||
 			die_with_patch $sha1 "Could not apply $sha1... $rest"
 		;;
-	edit)
+	edit|e)
 		comment_for_reflog edit
 
 		mark_action_done
@@ -254,7 +254,7 @@ do_next () {
 		warn
 		exit 0
 		;;
-	squash)
+	squash|s)
 		comment_for_reflog squash
 
 		has_action "$DONE" ||
@@ -263,7 +263,7 @@ do_next () {
 		mark_action_done
 		make_squash_message $sha1 > "$MSG"
 		case "$(peek_next_command)" in
-		squash)
+		squash|s)
 			EDIT_COMMIT=
 			USE_OUTPUT=output
 			cp "$MSG" "$SQUASH_MSG"
-- 
1.5.3.2.1102.g9487
Previous: Junio C HamanoNext: Avi Kivity
Message 3 of 9 in “rebase -i: support single-letter abbreviations for the actions”
  1. rebase -i: support single-letter abbreviations for the actionsJohannes Schindelin, Sep 29, 2007
  2. Junio C HamanoSep 29, 2007
  3. rebase -i: support single-letter abbreviations for the actionsJohannes Schindelin, Sep 29, 2007
  4. Avi KivitySep 29, 2007
  5. Johannes SchindelinSep 29, 2007
  6. Avi KivitySep 29, 2007
  7. Johannes SchindelinSep 29, 2007
  8. Junio C HamanoSep 29, 2007
  9. rebase -i: squash should retain the authorship of the _first_ commitJohannes Schindelin, Sep 29, 2007

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.