@matheusbsbs / matheus-bagliano / commits / 4e6738778b
Fork 0

Squelch bogus progress output from git-rebase--interactive

The command repeats "Rebasing (1/1)" many times even when there is only one task remaining, because mark_action_done() is called to skip comment and empty lines in the TODO file. This should fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jan 14, 2008 at 20:01 UTC 4e6738778b30a5063579ad4b4ba34e12547f0e7c
1 file changed +7 -2
git-rebase--interactive.sh
+7 -2
@@ -73,14 +73,19 @@ comment_for_reflog () {
73 esac
74 }
75
76 +last_count=
77 mark_action_done () {
78 sed -e 1q < "$TODO" >> "$DONE"
79 sed -e 1d < "$TODO" >> "$TODO".new
80 mv -f "$TODO".new "$TODO"
81 count=$(($(grep -ve '^$' -e '^#' < "$DONE" | wc -l)))
82 total=$(($count+$(grep -ve '^$' -e '^#' < "$TODO" | wc -l)))
82 - printf "Rebasing (%d/%d)\r" $count $total
83 - test -z "$VERBOSE" || echo
83 + if test "$last_count" != "$count"
84 + then
85 + last_count=$count
86 + printf "Rebasing (%d/%d)\r" $count $total
87 + test -z "$VERBOSE" || echo
88 + fi
89 }
90
91 make_patch () {