git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Christian Couder <christian.couder@gmail.com>,
	Pedro Larroy <pedro.larroy.lists@gmail.com>,
	git@vger.kernel.org
Subject: Re: git bisect should return 1 when the first bad commit is found
Date: Mon, 24 Jun 2019 22:13:03 -0700	[thread overview]
Message-ID: <xmqqv9wufdsw.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190625045304.GA7626@sigill.intra.peff.net> (Jeff King's message of "Tue, 25 Jun 2019 00:53:04 -0400")

Jeff King <peff@peff.net> writes:

> I do think that accessing the bisect/bad ref is a little intimate with
> the implementation (i.e., it implies knowing that there is only a single
> "bad" that we are moving around, unlike "good", where we may mark many
> such tips).

I actually do not think it is merely an implementation detail, but a
rather fundamental part of the "bisect" design.  After all, we are
trying to find *the* single transition point from "the old world" to
"the new world", and the primary assumption that makes "bisection"
work in the first place is that there is only one such transition
point from old to new.  Otherwise, there may be a stretch of history
where one transition from "old" to "new" is followed by another
transition from "new" back to "old" and then again another one from
"old" to "new"; in such a "stripe snake" part of the history, "find
the midpoint, if it is from the new world, then narrow to the world
before that midpoint", which is the central idea of the "bisection"
would not work, would it?

So, ... under that "single transition point" assumption, how would a
"bisect" that uses more than one "bad" would work?  "bad" is the one
that is known to belong to the "new" world that is topologically the
oldest and it moves backward in topology to find the boundary from
the "old" world.  If there were another "bad" (i.e. one that is
known to belong the the "new" world, that may not be the oldest),
shouldn't that have the other one as its ancestor, making it
redundant (i.e. we know we have inherited the badness from the other
one)?

Having said that ...

> So another option is to put the result in a new ref (bisect/result,
> perhaps), but with one twist: delete it at the beginning of a bisection,
> so its presence can be used as a marker that the bisection is complete.

... I kind of like this one exactly for the reasons you give below.

> I.e., you could do "git rev-parse --verify refs/bisect/result" as an
> alternative to "--exit-code". That gives you the added flexibility of
> asking "is the bisection done" separately from "do this next bisection
> step".
>
> -Peff

      reply	other threads:[~2019-06-25  5:13 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
2019-06-24 18:41       ` Junio C Hamano
2019-06-25  4:53         ` Jeff King
2019-06-25  5:13           ` Junio C Hamano [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

  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=xmqqv9wufdsw.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pedro.larroy.lists@gmail.com \
    --cc=peff@peff.net \
    /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).