From: Linus Torvalds <torvalds@osdl.org>
To: Peter Osterlund <petero2@telia.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git bisect idea: Asymmetric split points
Date: Sun, 8 Oct 2006 17:19:58 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0610081711370.3952@g5.osdl.org> (raw)
In-Reply-To: <m38xjqfk6r.fsf@telia.com>
On Sun, 9 Oct 2006, Peter Osterlund wrote:
>
> Does this sound like a good idea? Would it be hard to implement?
It should be very easy to implement.
See builtin-rev-list.c: find_bisection(), which has a _very_ simple way of
trying to find the best commit. It just counts the distance from the
commit:
distance = count_distance(p);
clear_distance(list);
where "distance" is really "how many commits will this cover".
If you wanted to get as close to (say) 75% of the total list of commits as
possible, you should just do something like
optimal = nr * percent / 100;
how_close = abs(optimal - distance);
if (how_close < closest) {
best = p;
closest = how_close;
}
instead of what we do now (which is just to say that "since we want to get
half-way, we want to make the biggest distance from _both_ 0 and from
"nr", which is what it calculates with
- If we're closer to "nr" than to 0 (ie the difference between nr and
distance is smaller than the difference between distance and 0), pick
the smaller difference:
if (nr - distance < distance)
distance = nr - distance;
- if this new distance is larger than any distance we've seen so far,
this is the best commit so far:
if (distance > closest) {
best = p;
closest = distance;
}
and notice how this is really just a special case of the percentage thing
when percent is 50%.
Linus
prev parent reply other threads:[~2006-10-09 0:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-08 23:43 git bisect idea: Asymmetric split points Peter Osterlund
2006-10-09 0:19 ` Linus Torvalds [this message]
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=Pine.LNX.4.64.0610081711370.3952@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=petero2@telia.com \
/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).