From 28c8cfc3635368f06f6deaedb5e90da328df27d2 Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Wed, 4 Mar 2015 02:53:04 -0500 Subject: [PATCH] rebase-interactive: suppress whitespace preceding item count 97f05f43 (Show number of TODO items for interactive rebase, 2014-12-10) taught rebase-interactive to compute an item count with 'wc -l' and display it in the instruction list comments: # Rebase 46640c6..5568fd5 onto 46640c6 (4 TODO item(s)) On Mac OS X, however, it renders as: # Rebase 46640c6..5568fd5 onto 46640c6 ( 4 TODO item(s)) since 'wc -l' indents its output with leading spaces. Fix this. Signed-off-by: Eric Sunshine Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 1 + t/t3404-rebase-interactive.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index c6a4629cbc..07512e4563 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -1032,6 +1032,7 @@ test -n "$autosquash" && rearrange_squash "$todo" test -n "$cmd" && add_exec_commands "$todo" todocount=$(git stripspace --strip-comments <"$todo" | wc -l) +todocount=${todocount##* } cat >>"$todo" <actual && + grep "^# Rebase ..* onto ..* ([0-9]" actual +' + test_done -- 2.11.4.GIT