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

[PATCH] calculate the maximal number of revisions to test

From
Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Date
Mar 17, 2007, 14:12 UTC
Message-ID
<20070317141209.GA7838@cepheus>
In-Reply-To
<Pine.LNX.4.63.0703170139110.22628@wbgn013.biozentrum.uni-wuerzburg.de>

Up to now the number printed was correct given that the current revision to test is bad.

Moreover I think the number printed was always one to high, this is fixed, too.
Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
---
 git-bisect.sh |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index b1c3a6b..a5b4fdd 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -150,8 +150,14 @@ bisect_next() {
 	    git-diff-tree --pretty $rev
 	    exit 0
 	fi
-	nr=$(eval "git-rev-list $rev $good -- $(cat $GIT_DIR/BISECT_NAMES)" | wc -l) || exit
-	echo "Bisecting: $nr revisions left to test after this"
+	nr_bad=$(eval "git-rev-list $rev^ $good -- $(cat $GIT_DIR/BISECT_NAMES)" | wc -l) || exit
+	nr_good=$(eval "git-rev-list $bad^ ^$rev $good -- $(cat $GIT_DIR/BISECT_NAMES)" | wc -l) || exit
+	if test "$nr_bad" -ge "$nr_good"; then
+		nr="$nr_bad";
+	else
+		nr="$nr_good";
+	fi;
+	echo "Bisecting: maximal $nr revisions left to test after this"
 	echo "$rev" > "$GIT_DIR/refs/heads/new-bisect"
 	git checkout -q new-bisect || exit
 	mv "$GIT_DIR/refs/heads/new-bisect" "$GIT_DIR/refs/heads/bisect" &&
-- 
1.5.0.2.260.g2eb065


-- 
Uwe Kleine-König

http://www.google.com/search?q=Planck%27s+constant%3D
Previous: Uwe Kleine-KönigNext: Johannes Schindelin
Message 4 of 18 in “[BUG] bisecting miscounts revisions left to test”
  1. Uwe Kleine-KönigMar 16, 2007
  2. Johannes SchindelinMar 17, 2007
  3. Uwe Kleine-KönigMar 17, 2007
  4. calculate the maximal number of revisions to testUwe Kleine-König, Mar 17, 2007
  5. Johannes SchindelinMar 17, 2007
  6. Uwe Kleine-KönigMar 17, 2007
  7. Bisect: fix calculation of the number of suspicious revisionsUwe Kleine-König, Mar 21, 2007
  8. Junio C HamanoMar 21, 2007
  9. Uwe Kleine-KönigMar 21, 2007
  10. Uwe Kleine-KönigMar 21, 2007
  11. Junio C HamanoMar 21, 2007
  12. Linus TorvaldsMar 21, 2007
  13. Junio C HamanoMar 22, 2007
  14. bisect: show the maximal number of commits to be testedJohannes Schindelin, Mar 22, 2007
  15. Junio C HamanoMar 22, 2007
  16. Johannes SchindelinMar 22, 2007
  17. 1/2 git-rev-list: add --bisect-vars option.Junio C Hamano, Mar 22, 2007
  18. 2/2 git-rev-list --bisect: optimizationJunio C Hamano, Mar 22, 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.