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

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)?

Previous: Christian CouderNext: Christian Couder
Message 2 of 13 in “rev-list: estimate number of bisection step left”
  1. rev-list: estimate number of bisection step leftChristian Couder, Feb 17, 2009
  2. Junio C HamanoFeb 17, 2009
  3. Christian CouderFeb 19, 2009
  4. Christian CouderFeb 19, 2009
  5. Christian CouderFeb 19, 2009
  6. John TapsellFeb 19, 2009
  7. Christian CouderFeb 19, 2009
  8. Johannes SchindelinFeb 17, 2009
  9. John TapsellFeb 17, 2009
  10. Johannes SchindelinFeb 17, 2009
  11. John TapsellFeb 17, 2009
  12. Johannes SchindelinFeb 17, 2009
  13. Thomas RastFeb 17, 2009

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.