summaryrefslogtreecommitdiff
path: root/t/t6030-bisect-porcelain.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-06-13 07:21:06 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-13 10:47:34 -0700
commitebc9529f0358bdb10192fa27bc75f5d4e452ce90 (patch)
treea96512d00de09a2f767544f390cca87ca7844253 /t/t6030-bisect-porcelain.sh
parenta66037c9755a2beb49bbd915e6f0dd9b1a732925 (diff)
downloadgit-ebc9529f0358bdb10192fa27bc75f5d4e452ce90.tar.gz
bisect: use a PRNG with a bias when skipping away from untestable commits
Using a PRNG (pseudo random number generator) with a bias should be better than alternating between 3 fixed ratios. In repositories with many untestable commits it should prevent alternating between areas where many commits are untestable. The bias should favor commits that can give more information, so that the bisection process should not loose much efficiency. HPA suggested to use a PRNG and found that the best bias is to raise a ratio between 0 and 1 given by the PRNG to the power 1.5. An integer square root function is implemented to avoid including <math.h> and linking with -lm. A PRNG function is implemented to get the same number sequence on different machines as suggested by "man 3 rand". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6030-bisect-porcelain.sh')
-rwxr-xr-xt/t6030-bisect-porcelain.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 4556cdd8d2..1315bab595 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -563,8 +563,8 @@ test_expect_success 'skipping away from skipped commit' '
hash7=$(git rev-parse --verify HEAD) &&
test "$hash7" = "$HASH7" &&
git bisect skip &&
- hash3=$(git rev-parse --verify HEAD) &&
- test "$hash3" = "$HASH3"
+ para3=$(git rev-parse --verify HEAD) &&
+ test "$para3" = "$PARA_HASH3"
'
#