From: Junio C Hamano <junkio@cox.net>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Bisect: add checks at the beginning of "git bisect run".
Date: Wed, 28 Mar 2007 23:06:42 -0700 [thread overview]
Message-ID: <7virck8txp.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 200703290702.47972.chriscool@tuxfamily.org
Christian Couder <chriscool@tuxfamily.org> writes:
> So while we are at it, what about a new subcommand "git bisect test" that
> could be used like this:
You are using it as a building block for nightly script, so
there are already certain logic around the call to "git bisect"
in your script. I do not think we would necessarily want more
subcommands to "git bisect", unless the new subcommands truly is
generally applicable.
Unlike "run", "test" expects a workflow where there always is
one recent good_rev and there might be at most one single
breakage introduced since the last nightly build. For that
particular use case, it might be handier to be able to write a
single line:
> git bisect test good_rev my_script
compared to:
> my_script || {
> git bisect start &&
> git bisect bad &&
> git bisect good good_rev &&
> git bisect run my_script
> }
but it is not useful for use case other than that. Maybe we
already know more than one good commits that are on the side
branch to limit the bisect space in project specific way.
The thing is, the more you add policy to a building block, the
less generally useful the building block becomes. The reason I
took "git bisect run" is because for the simplest use case, it
can be used without writing a specialized "run script" (you can
give "make test" to it, for example). And more importantly, in
the case of "run", there is not much policy involved. It is a
good command to have in a building block because what it does is
purely to automate what the user would perform mechanically by
hand anyway. One thing I would want is to keep the bisect
subcommands to the minimum, so that people can easily use it as
a building block in their automation, without having to hunt
through many workflow-specific subcommands that do not suit
their particular needs. Catering to their particular needs are
better handled in their scripts, including your "I have one
known good commit, I do not know if the tip is good, and I want
to dig down from the tip only when the tip is bad" case.
If you want to add value to bisect, here are two I can think of,
one almost trivial, and the other a bit harder.
(1) One bad commit is fundamentally needed for bisect to run,
and if we beforehand know more good commits, we can narrow
the bisect space down without doing the whole tree checkout
every time we give good commits. I think it may be a good
idea to have:
git bisect start [$bad [$good1 $good2...]] [-- <paths>...]
as a short-hand for this command sequence:
git bisect start
git bisect bad $bad
git bisect good $good1 $good2...
That would be a good script-shorterner, without limiting it to
any specific use scenario.
(2) There is no technical reason to have a good commit for
bisect to run, other than you _often_ do not want the first
mid-point checkout before you give good ones to it. But
sometimes, you may not know even if something _ever_ worked,
IOW, even the root commit might not be good. In such a
case, being able to bisect having only one bad commit and no
good commit would be handy. For this, bisect_next_check
needs to be tweaked. Probably a transcript for such a
feature would go like this:
$ git bisect start
$ git bisect bad HEAD
$ git bisect next ; echo $?
You need to give me at least one good and one bad revisions,
with "git bisect good" and "git bisect bad".
1
$ git bisect next --without-good
Bisecting: 4321 revisions left to test after this
[deadcafedeadcafedeadcafedeadcafedeadcafe] an ancient commit
$ git bisect bad
Bisecting: 2152 revisions left to test after this
[edeadcafedeadcafedeadcafedeadcafedeadcaf] a more ancient commit
next prev parent reply other threads:[~2007-03-29 6:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-27 4:49 [PATCH] Bisect: add checks at the beginning of "git bisect run" Christian Couder
2007-03-27 5:28 ` Junio C Hamano
2007-03-27 7:15 ` Christian Couder
2007-03-27 7:22 ` Junio C Hamano
2007-03-27 5:46 ` Junio C Hamano
2007-03-28 3:44 ` Christian Couder
2007-03-28 5:46 ` Junio C Hamano
2007-03-28 7:52 ` Christian Couder
2007-03-28 7:57 ` Junio C Hamano
2007-03-29 5:02 ` Christian Couder
2007-03-29 6:06 ` Junio C Hamano [this message]
2007-04-05 8:01 ` Christian Couder
2007-04-05 8:05 ` Christian Couder
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=7virck8txp.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=chriscool@tuxfamily.org \
--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.