git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>
To: git@vger.kernel.org
Subject: [PATCH] calculate the maximal number of revisions to test
Date: Sat, 17 Mar 2007 15:12:09 +0100	[thread overview]
Message-ID: <20070317141209.GA7838@cepheus> (raw)
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

  parent reply	other threads:[~2007-03-17 14:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16 16:14 [BUG] bisecting miscounts revisions left to test Uwe Kleine-König
2007-03-17  0:50 ` Johannes Schindelin
2007-03-17 13:46   ` Uwe Kleine-König
2007-03-17 14:12   ` Uwe Kleine-König [this message]
2007-03-17 17:49     ` [PATCH] calculate the maximal number of revisions " Johannes Schindelin
2007-03-17 19:58       ` Uwe Kleine-König
2007-03-21 21:04         ` [PATCH] Bisect: fix calculation of the number of suspicious revisions Uwe Kleine-König
2007-03-21 21:23           ` Junio C Hamano
2007-03-21 21:39             ` Uwe Kleine-König
2007-03-21 21:34           ` Uwe Kleine-König
2007-03-21 21:49             ` Junio C Hamano
2007-03-21 22:27           ` Linus Torvalds
2007-03-22  1:19             ` Junio C Hamano
2007-03-22  1:43             ` [PATCH] bisect: show the maximal number of commits to be tested Johannes Schindelin
2007-03-22  2:05               ` Junio C Hamano
2007-03-22  2:15                 ` Johannes Schindelin
2007-03-22  6:36               ` [PATCH 1/2] git-rev-list: add --bisect-vars option Junio C Hamano
2007-03-22  6:42               ` [PATCH 2/2] git-rev-list --bisect: optimization Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070317141209.GA7838@cepheus \
    --to=ukleinek@informatik.uni-freiburg.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).