From 7a36302cd7beaf5ee00f0c8b264ba9487d43391c Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Tue, 25 Apr 2017 20:26:23 +0200 Subject: [PATCH] git-step-rebase: try the faster standard rebase mode. Standard mode, like without ignoring whitespace changes. Only if that fails, try again with whitespace ignorance. Reason for this attempt is, rebases not ignoring whitespace are significantly faster and much less verbose. As 99% of all rebases work fine without ignoring whitespace, it's a good idea to try that first. --- tools/git-step-rebase | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/git-step-rebase b/tools/git-step-rebase index e2cd4ae..d19414e 100755 --- a/tools/git-step-rebase +++ b/tools/git-step-rebase @@ -55,8 +55,14 @@ wait_count 5 while [ ${PARENTS} -ge 0 ]; do echo -e "Next: rebasing to \033[1m${BASE_BRANCH}~${PARENTS}\033[0m" sleep 1 - if ! git rebase -X ignore-all-space --whitespace=fix ${BASE_BRANCH}~${PARENTS}; then - exit + if ! git rebase --whitespace=fix ${BASE_BRANCH}~${PARENTS}; then + echo + echo "Standard rebase failed." + echo "Trying again, this time ignoring whitespace ..." + git rebase --abort + if ! git rebase -X ignore-all-space --whitespace=fix ${BASE_BRANCH}~${PARENTS}; then + exit + fi fi let PARENTS=${PARENTS}-1 done