diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-07-14 16:45:11 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-27 15:35:05 -0700 |
commit | 3546c8d927d31048f0d6f41aa132ebdb82cf8bda (patch) | |
tree | a55c2138c0cc1d80b83390964d929bde54f520d7 /git-rebase--interactive.sh | |
parent | rebase -i: do not invent onelines when expanding/collapsing SHA-1s (diff) | |
download | tgif-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.sh | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 9d65212b7f..d5df02435a 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 |