git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Squelch bogus progress output from git-rebase--interactive

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 15, 2008, 04:04 UTC
Message-ID
<7v3aszivjk.fsf@gitster.siamese.dyndns.org>

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
Next: Johannes Schindelin
Message 1 of 2 in “Squelch bogus progress output from git-rebase--interactive”
  1. Squelch bogus progress output from git-rebase--interactiveJunio C Hamano, Jan 15, 2008
  2. Johannes SchindelinJan 15, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.