aboutsummaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorAndrew Wong <andrew.kw.w@gmail.com>2012-09-17 21:28:08 -0400
committerJunio C Hamano <gitster@pobox.com>2012-09-17 20:58:55 -0700
commitfcc5ef1cc90ed49400bef51d306216f290eab9cc (patch)
tree655c455b1531cb06fe4094632ec1c20c55ad07f3 /git-rebase--interactive.sh
parent6ef59319438ba89bf2979baa86fdb9bd1922f659 (diff)
downloadgit-fcc5ef1cc90ed49400bef51d306216f290eab9cc.tar.gz
git-fcc5ef1cc90ed49400bef51d306216f290eab9cc.tar.xz
rebase -i: Refactor help messages for todo file
Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh31
1 files changed, 20 insertions, 11 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index a09e8423d..4d57e50f2 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -115,6 +115,23 @@ mark_action_done () {
fi
}
+append_todo_help () {
+ cat >> "$todo" << EOF
+#
+# Commands:
+# p, pick = use commit
+# r, reword = use commit, but edit the commit message
+# e, edit = use commit, but stop for amending
+# s, squash = use commit, but meld into previous commit
+# f, fixup = like "squash", but discard this commit's log message
+# x, exec = run command (the rest of the line) using shell
+#
+# These lines can be re-ordered; they are executed from top to bottom.
+#
+# If you remove a line here THAT COMMIT WILL BE LOST.
+EOF
+}
+
make_patch () {
sha1_and_parents="$(git rev-list --parents -1 "$1")"
case "$sha1_and_parents" in
@@ -901,18 +918,10 @@ test -n "$cmd" && add_exec_commands "$todo"
cat >> "$todo" << EOF
# Rebase $shortrevisions onto $shortonto
+EOF
+append_todo_help
+cat >> "$todo" << EOF
#
-# Commands:
-# p, pick = use commit
-# r, reword = use commit, but edit the commit message
-# e, edit = use commit, but stop for amending
-# s, squash = use commit, but meld into previous commit
-# f, fixup = like "squash", but discard this commit's log message
-# x, exec = run command (the rest of the line) using shell
-#
-# These lines can be re-ordered; they are executed from top to bottom.
-#
-# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
EOF