rebase -i: also expand/collapse the SHA-1s via the rebase--helper
[gitweb.git] / git-rebase--interactive.sh
index 05766835de10455c57c9d1eaf3059bc19f6ccce8..d5df02435ae77165a0def4c135d152c60c6673a5 100644 (file)
@@ -155,13 +155,13 @@ reschedule_last_action () {
 append_todo_help () {
        gettext "
 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
- d, drop = remove commit
+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
+d, drop = remove commit
 
 These lines can be re-ordered; they are executed from top to bottom.
 " | git stripspace --comment-lines >>"$todo"
@@ -750,30 +750,12 @@ skip_unnecessary_picks () {
                die "$(gettext "Could not skip unnecessary pick commands")"
 }
 
-transform_todo_ids () {
-       while read -r command rest
-       do
-               case "$command" in
-               "$comment_char"* | exec)
-                       # Be careful for oddball commands like 'exec'
-                       # that do not have a SHA-1 at the beginning of $rest.
-                       ;;
-               *)
-                       sha1=$(git rev-parse --verify --quiet "$@" ${rest%%[     ]*}) &&
-                       rest="$sha1 ${rest#*[    ]}"
-                       ;;
-               esac
-               printf '%s\n' "$command${rest:+ }$rest"
-       done <"$todo" >"$todo.new" &&
-       mv -f "$todo.new" "$todo"
-}
-
 expand_todo_ids() {
-       transform_todo_ids
+       git rebase--helper --expand-ids
 }
 
 collapse_todo_ids() {
-       transform_todo_ids --short
+       git rebase--helper --shorten-ids
 }
 
 # Rearrange the todo list that has both "pick sha1 msg" and