git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] rev-list: estimate number of bisection step left
Date: Mon, 16 Feb 2009 23:28:18 -0800	[thread overview]
Message-ID: <7vljs58qul.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20090217060944.488184b0.chriscool@tuxfamily.org> (Christian Couder's message of "Tue, 17 Feb 2009 06:09:44 +0100")

Christian Couder <chriscool@tuxfamily.org> writes:

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

  reply	other threads:[~2009-02-17  7:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  5:09 [PATCH] rev-list: estimate number of bisection step left Christian Couder
2009-02-17  7:28 ` Junio C Hamano [this message]
2009-02-19  5:16   ` Christian Couder
2009-02-19  5:26     ` Christian Couder
2009-02-19  5:32     ` Christian Couder
2009-02-19  6:02       ` John Tapsell
2009-02-19  6:49         ` Christian Couder
2009-02-17 14:44 ` Johannes Schindelin
2009-02-17 15:11   ` John Tapsell
2009-02-17 15:31     ` Johannes Schindelin
2009-02-17 15:36       ` John Tapsell
2009-02-17 15:39         ` Johannes Schindelin
2009-02-17 15:39       ` Thomas Rast

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=7vljs58qul.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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).