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

[PATCH 3/5] rebase -i: Fix numbers in progress report

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 25, 2007, 15:43 UTC
Message-ID
<Pine.LNX.4.64.0709251642560.28395@racer.site>
In-Reply-To
<Pine.LNX.4.64.0709251640360.28395@racer.site>

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>
---
 git-rebase--interactive.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index c850411..4f46a15 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -72,8 +72,8 @@ mark_action_done () {
 	sed -e 1q < "$TODO" >> "$DONE"
 	sed -e 1d < "$TODO" >> "$TODO".new
 	mv -f "$TODO".new "$TODO"
-	count=$(($(wc -l < "$DONE")))
-	total=$(($count+$(wc -l < "$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
 }
-- 
1.5.3.2.1057.gf4dc1
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 9 in “Two real fixes, two minor fixes, and a style fix”
  1. 0/5 Two real fixes, two minor fixes, and a style fixJohannes Schindelin, Sep 25, 2007
  2. 1/5 rebase -i: commit when continuing after "edit"Johannes Schindelin, Sep 25, 2007
  3. 2/5 rebase -i: style fixes and minor cleanupsJohannes Schindelin, Sep 25, 2007
  4. 3/5 rebase -i: Fix numbers in progress reportJohannes Schindelin, Sep 25, 2007
  5. 4/5 rebase -i: work on a detached HEADJohannes Schindelin, Sep 25, 2007
  6. 5/5 rebase -i: avoid exporting GIT_AUTHOR_* variablesJohannes Schindelin, Sep 25, 2007
  7. Johannes SixtSep 26, 2007
  8. Johannes SchindelinSep 26, 2007
  9. Johannes SixtSep 26, 2007

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.