[PATCH] rebase -i: Teach "--edit" action
From: Andrew Wong <hidden>
Date: 2016-06-15 22:54:42
Subsystem:
the rest · Maintainer:
Linus Torvalds
This allows users to edit the todo list while they're in the middle of an interactive rebase. Signed-off-by: Andrew Wong <redacted> --- git-rebase--interactive.sh | 6 ++++++ git-rebase.sh | 14 ++++++++++++++ 2 files changed, 20 insertions(+)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index a09e842..e9dbcf3 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh@@ -775,6 +775,12 @@ skip) do_rest ;; +edit) + git_sequence_editor "$todo" || + die_abort "Could not execute editor" + + exit + ;; esac git var GIT_COMMITTER_IDENT >/dev/null ||
diff --git a/git-rebase.sh b/git-rebase.sh
index 15da926..c394b8d 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh@@ -38,6 +38,7 @@ C=! passed to 'git apply' continue! continue abort! abort and check out the original branch skip! skip current patch and continue +edit! edit the todo list during interactive rebase " . git-sh-setup . git-sh-i18n
@@ -194,6 +195,10 @@ do test $total_argc -eq 2 || usage action=${1##--} ;; + --edit) + test $total_argc -eq 2 || usage + action=${1##--} + ;; --onto) test 2 -le "$#" || usage onto="$2"
@@ -306,6 +311,12 @@ then fi fi +if test "$action" = "edit" && + test "$type" != "interactive" +then + die "$(gettext "The --edit action can only be used during interactive rebase.")" +fi + case "$action" in continue) # Sanity check
@@ -338,6 +349,9 @@ abort) rm -r "$state_dir" exit ;; +edit) + run_specific_rebase + ;; esac # Make sure no rebase is in progress
--
1.7.12.289.g0ce9864.dirty