[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