From eb9a7cb4bdbd4ea9c7e7ef2ca8de5b2753e3584c Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Mon, 17 Sep 2012 21:28:09 -0400 Subject: rebase -i: Teach "--edit-todo" action This allows users to edit the todo file while they're stopped in the middle of an interactive rebase. When this action is executed, all comments from the original todo file are stripped, and new help messages are appended to the end. Signed-off-by: Andrew Wong Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'git-rebase--interactive.sh') diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 4d57e50f2..2b8f2a9f4 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -792,6 +792,23 @@ skip) do_rest ;; +edit-todo) + sed -e '/^#/d' < "$todo" > "$todo".new + mv -f "$todo".new "$todo" + append_todo_help + cat >> "$todo" << EOF +# +# You are editing the todo file of an ongoing interactive rebase. +# To continue rebase after editing, run: +# git rebase --continue +# +EOF + + git_sequence_editor "$todo" || + die "Could not execute editor" + + exit + ;; esac git var GIT_COMMITTER_IDENT >/dev/null || -- cgit v1.2.1