All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: darxus@chaosreigns.com
Cc: git@vger.kernel.org
Subject: Re: Feature request: don't require both bad and good when bisecting
Date: Mon, 19 Mar 2012 15:45:31 +0100	[thread overview]
Message-ID: <4F67468B.4070502@op5.se> (raw)
In-Reply-To: <20120318212957.GS1219@chaosreigns.com>

On 03/18/2012 10:29 PM, darxus@chaosreigns.com wrote:
> I'd like to be able to tell get only that I know the latest commit is bad,
> and have it go find a good commit, then do the bisecting.  Maybe something
> like the opposite of a binary search, start with the last commit, then
> second to last, then 4th to last, 8th to last, etc., till it finds a good
> commit.
> 

Assuming the good commit is the 13'th from HEAD, you'd get the same nr
of attempts by just specifying a commit 100 revisions in the past and
doing the already implemented binary search as you would from trying 4
commits at a time to get at the good one.

Binary search is a "divide and conquer" algorithm (running in O(log n)
time), so it handles extremely large datasets very efficiently. As such,
it's (almost) always easier to just specify a revision really far back
in history and let it get to work. If you specify a range of 1000000
commits, it will take 20 attempts to find the right one ("git bisect"
has to exclude all possible candidates for both sides, so it always
runs in worst-case time, even when it hits the correct commit on the
first check).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

  reply	other threads:[~2012-03-19 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-18 21:29 Feature request: don't require both bad and good when bisecting darxus
2012-03-19 14:45 ` Andreas Ericsson [this message]
2012-03-19 15:30   ` Jeff King
2012-03-19 16:24     ` Andreas Ericsson
2012-03-19 16:45       ` Jeff King
2012-03-19 16:49       ` Junio C Hamano

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=4F67468B.4070502@op5.se \
    --to=ae@op5.se \
    --cc=darxus@chaosreigns.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.