git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Squelch bogus progress output from git-rebase--interactive
@ 2008-01-15  4:04 Junio C Hamano
  2008-01-15 11:22 ` Johannes Schindelin
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2008-01-15  4:04 UTC (permalink / raw)
  To: git

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>
---
 git-rebase--interactive.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index acdcc54..402ff37 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -73,14 +73,19 @@ comment_for_reflog () {
 	esac
 }
 
+last_count=
 mark_action_done () {
 	sed -e 1q < "$TODO" >> "$DONE"
 	sed -e 1d < "$TODO" >> "$TODO".new
 	mv -f "$TODO".new "$TODO"
 	count=$(($(grep -ve '^$' -e '^#' < "$DONE" | wc -l)))
 	total=$(($count+$(grep -ve '^$' -e '^#' < "$TODO" | wc -l)))
-	printf "Rebasing (%d/%d)\r" $count $total
-	test -z "$VERBOSE" || echo
+	if test "$last_count" != "$count"
+	then
+		last_count=$count
+		printf "Rebasing (%d/%d)\r" $count $total
+		test -z "$VERBOSE" || echo
+	fi
 }
 
 make_patch () {
-- 
1.5.4.rc3.10.g471a

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Squelch bogus progress output from git-rebase--interactive
  2008-01-15  4:04 [PATCH] Squelch bogus progress output from git-rebase--interactive Junio C Hamano
@ 2008-01-15 11:22 ` Johannes Schindelin
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Schindelin @ 2008-01-15 11:22 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Mon, 14 Jan 2008, Junio C Hamano wrote:

> 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.

Yes, it should.

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-15 11:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15  4:04 [PATCH] Squelch bogus progress output from git-rebase--interactive Junio C Hamano
2008-01-15 11:22 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).