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 <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Andrew Wong
2012-09-17 21:28:09 -04:00
committed by Junio C Hamano
parent fcc5ef1cc9
commit eb9a7cb4bd
3 changed files with 32 additions and 3 deletions

View File

@ -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 ||