Re: [PATCH] rev-list: estimate number of bisection step left
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 17, 2009, 07:28 UTC
- Message-ID
- <7vljs58qul.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20090217060944.488184b0.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 26 quoted lines
> +static int estimate_bisect_steps(int all)
> +{
> + int log2 = 0;
> + int left = (all >> 1) - 1;
> +
> + if (left <= 0)
> + return 0;
> +
> + do {
> + left = left >> 1;
> + log2++;
> + } while (left);
> +
> + return log2;
> +}
> ...
> diff --git a/git-bisect.sh b/git-bisect.sh
> index 85db4ba..6b23439 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -500,7 +500,7 @@ bisect_next() {
> # commit is also a "skip" commit (see above).
> exit_if_skipped_commits "$bisect_rev"
>
> - bisect_checkout "$bisect_rev" "$bisect_nr revisions left to test after this"
> + bisect_checkout "$bisect_rev" "$bisect_nr revisions left to test after this (roughtly $bisect_steps steps)""roughly".
all left 0 0 1 0 2 0 3 0 4 1 5 1 6 2 7 2 8 2 9 2
It seems that at the very low end the estimate is a bit too optimistic. How about showing this number from the Porcelain only when $bisect_steps is more than 2 (or all is more than 9)?