@matheusbsbs / matheus-bagliano / commits / dad4e32c46
Fork 0

rebase -i: Fix numbers in progress report

Instead of counting all lines in done and todo, we now count the actions before outputting "$Rebasing ($count/$total)". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Sep 25, 2007 at 16:43 UTC dad4e32c4658f12a6eaa2decead5d77678911d95
1 file changed +2 -2
git-rebase--interactive.sh
+2 -2
@@ -72,8 +72,8 @@ mark_action_done () {
72 sed -e 1q < "$TODO" >> "$DONE"
73 sed -e 1d < "$TODO" >> "$TODO".new
74 mv -f "$TODO".new "$TODO"
75 - count=$(($(wc -l < "$DONE")))
76 - total=$(($count+$(wc -l < "$TODO")))
75 + count=$(($(grep -ve '^$' -e '^#' < "$DONE" | wc -l)))
76 + total=$(($count+$(grep -ve '^$' -e '^#' < "$TODO" | wc -l)))
77 printf "Rebasing (%d/%d)\r" $count $total
78 test -z "$VERBOSE" || echo
79 }