From 3546c8d927d31048f0d6f41aa132ebdb82cf8bda Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 14 Jul 2017 16:45:11 +0200 Subject: rebase -i: also expand/collapse the SHA-1s via the rebase--helper This is crucial to improve performance on Windows, as the speed is now mostly dominated by the SHA-1 transformation (because it spawns a new rev-parse process for *every* line, and spawning processes is pretty slow from Git for Windows' MSYS2 Bash). Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'git-rebase--interactive.sh') diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 9d65212b7..d5df02435 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -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 -- cgit v1.2.1