From: Jeff King <peff@peff.net>
To: Christian Couder <christian.couder@gmail.com>
Cc: Pedro Larroy <pedro.larroy.lists@gmail.com>,
Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: Re: git bisect should return 1 when the first bad commit is found
Date: Tue, 25 Jun 2019 00:58:49 -0400 [thread overview]
Message-ID: <20190625045848.GA7571@sigill.intra.peff.net> (raw)
In-Reply-To: <CAP8UFD1gWnkJZSzjOxOHdS4R3GCUSDgC9X85y_Yvc0LmyK19Cw@mail.gmail.com>
On Mon, Jun 24, 2019 at 09:16:13AM +0200, Christian Couder wrote:
> So you just need to parse stdout to detect that it found the first bad
> commit, and then you can use refs/bisect/bad.
>
> If the return code was used, how would you distinguish between a
> failure in the command (for example if you give bad information to
> `git bisect good` or `git bisect bad`) and the fact that it has not
> yet found the first bad commit? Anyway you would need to add some
> logic for that.
Right, thanks for reminding us of that ref. I did leave a suggestion
elsewhere in the thread that we might be able to avoid the exit-code
pitfalls by using a specific "result" ref.
> If it would be HEAD, it would mean that git bisect would potentially
> have to do one more checkout so that HEAD points to the first bad
> commit. This checkout would sometimes be useless, so it's more
> efficient to use something like refs/bisect/bad rather than HEAD.
I'm not too concerned with the cost of checking out a tree. After all,
we've just done a bunch of checkouts and probably some operations on the
tree itself. But I think there's a much more important reason my
suggestion may have problems.
Sometimes we _can't_ checkout another commit, because part of testing
the bisection may involve mucking with the working tree. For instance,
earlier today I was bisecting a case where git.git did not show the
breakage itself, but applying a debugging patch on top did. So I was
bisecting along the real history, adding new contents, testing, and then
cleaning up my changes before jumping to the next bisection candidate.
On the other hand, I have to clean them up anyway before running "git
bisect good" or it cannot jump to the next candidate when we are not
finished. Jumping to "bad" when we _are_ finished is no different there.
But I think it does show that there can be surprising implications to
moving HEAD around.
-Peff
next prev parent reply other threads:[~2019-06-25 4:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 22:33 git bisect should return 1 when the first bad commit is found Pedro Larroy
2019-06-13 18:22 ` Junio C Hamano
2019-06-23 20:32 ` Pedro Larroy
2019-06-23 22:49 ` Jeff King
2019-06-24 7:16 ` Christian Couder
2019-06-25 4:58 ` Jeff King [this message]
2019-06-24 18:41 ` Junio C Hamano
2019-06-25 4:53 ` Jeff King
2019-06-25 5:13 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190625045848.GA7571@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pedro.larroy.lists@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).