Skip to content

Commit

Permalink
rebase -i: Refactor help messages for todo file
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Andrew Wong authored and Junio C Hamano committed Sep 18, 2012
1 parent 6ef5931 commit fcc5ef1
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fcc5ef1

Please sign in to comment.