rebase -i: also expand/collapse the SHA-1s via the rebase--helper
[gitweb.git] / git-rebase--interactive.sh
index 9d65212b7f12d064d24b7354a16a54bc0cb18092..d5df02435ae77165a0def4c135d152c60c6673a5 100644 (file)
@@ -750,35 +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%%[     ]*}) &&
-                       if test "a$rest" = "a${rest#*[   ]}"
-                       then
-                               rest=$sha1
-                       else
-                               rest="$sha1 ${rest#*[    ]}"
-                       fi
-                       ;;
-               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