aboutsummaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-07-14 16:45:11 +0200
committerJunio C Hamano <gitster@pobox.com>2017-07-27 15:35:05 -0700
commit3546c8d927d31048f0d6f41aa132ebdb82cf8bda (patch)
treea55c2138c0cc1d80b83390964d929bde54f520d7 /git-rebase--interactive.sh
parent1f4044af7f35f9979d464bc2009b554e8e9dfb99 (diff)
downloadgit-3546c8d927d31048f0d6f41aa132ebdb82cf8bda.tar.gz
git-3546c8d927d31048f0d6f41aa132ebdb82cf8bda.tar.xz
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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh27
1 files changed, 2 insertions, 25 deletions
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