From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org, Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: [PATCH 1/2] bisect: parse revs before passing them to check_expected_revs()
Date: Mon, 29 Dec 2014 11:33:49 -0800 [thread overview]
Message-ID: <xmqqegriz1wi.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20141225182534.32540.83491.chriscool@tuxfamily.org> (Christian Couder's message of "Thu, 25 Dec 2014 19:25:32 +0100")
Christian Couder <chriscool@tuxfamily.org> writes:
> When running for example "git bisect bad HEAD" or
> "git bisect good master", the parameter passed to
> "git bisect (bad|good)" has to be parsed into a
> commit hash before checking if it is the expected
> commit or not.
Hmm, is that because you wrote commit object name in 40-hex in the
EXPECTED_REV and you need to compare with what the user gave you
which could be symbolic?
The conversion makes sense, but why is it a bad thing to say
git bisect bad maint
when 'maint' is not what you checked out in the current bisect run
in the first place (perhaps you checked if it is good or bad manually
before you started bisecting)?
> diff --git a/git-bisect.sh b/git-bisect.sh
> index 6cda2b5..2fc07ac 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -237,15 +237,18 @@ bisect_state() {
> check_expected_revs "$rev" ;;
> 2,bad|*,good|*,skip)
This part accepts arbitrary number of revs when running good and
skip, e.g.
git bisect good maint master next
and it loops
> shift
> - eval=''
> + hash_list=''
> for rev in "$@"
> ...
> + for rev in $hash_list
> + do
> + bisect_write "$state" "$rev"
> + done
> + check_expected_revs $hash_list ;;
But check_expected_revs loops and leaves the loop early when it
finds anything that is not expected.
... goes and looks ...
Hmph, I think the logic in check_expected_revs is not wrong, but
this helper function is grossly misnamed. It is not checking and
rejecting the user input---it is checking to see if it can bypass
check_good_are_ancestors_of_bad() which is expensive, so when it
sees any one of the input is not what it checked out, it just
disables the "optimization".
OK, will queue.
Thanks.
next prev parent reply other threads:[~2014-12-29 19:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-25 18:25 [PATCH 1/2] bisect: parse revs before passing them to check_expected_revs() Christian Couder
2014-12-29 19:33 ` Junio C Hamano [this message]
2014-12-29 22:01 ` 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=xmqqegriz1wi.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=schwab@linux-m68k.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 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).