git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Alex Hoffman <spec@gal.ro>, Johannes Sixt <j6t@kdbg.org>,
	Stephan Beyer <s-beyer@gmx.net>, git <git@vger.kernel.org>
Subject: Re: Git bisect does not find commit introducing the bug
Date: Mon, 20 Feb 2017 01:02:33 -0800	[thread overview]
Message-ID: <xmqqy3x1jkuu.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAP8UFD3ngMvVy2XLzYNn9OFbS+zQpWTW=pravpHhA-0PcDVhfg@mail.gmail.com> (Christian Couder's message of "Sat, 18 Feb 2017 20:58:59 +0100")

Christian Couder <christian.couder@gmail.com> writes:

> git bisect makes some assumptions that are true most of the time, so
> in practice it works well most of the time.

I think we need to clarify the documentation and ask you to stop
using such fuzzy phrases like "assumptions" and "most of the time"
;-).

For bisection to work, "git bisect" requires a very simple thing,
which is that your history is bisectable wrt one particular "trait",
i.e. what you are interested in (e.g. the trait may be "the commit
has this feature in a broken form").

What does it mean for a history to be "bisectable", then?

A bisectable history has commits with the "trait" and commits
without the "trait".  Given any commit with the "trait", all commits
that are decendant of such commit must have the "trait".  Also given
any commit without the "trait", all commits that are ancestor of
such a commit must not have the "trait".

And your goal is to find one commit with the "trait" whose direct
parent commits all lack the "trait".

If and only if you can formulate your problem into the above form,
"git bisect" can help you by not requiring you to check each and
every commit in the history.

Depending on the way you define the "trait", your history may not be
bisectable, but by formulating the "trait" carefully, many such
history can be made bisectable.  In the "Recently some commit broke
feature X.  Before then the feature used to work.  In an ancient
past, the feature did not even exist" example, if you set "trying to
use feature X breaks" as the "trait", your history is not bisectable
unless you ignore the ancient part that did not even have the
feature.  If you restate your "trait" to "feature X does not exist
in a broken form", however, the history becomes bisectable.

Historically, we called commits with "trait" BAD and others GOOD,
because bisection was used primarily to hunt for bugs.  It may be
easier to understand if the user thinks of commits without "trait"
as OLD (i.e. commits in the older part of the history are not yet
contaminated), and commits with "trait" as NEW (i.e. at some point,
there is an event to introduce the "trait" and newer part of the
history is contaminated by that event ever since).

  parent reply	other threads:[~2017-02-20  9:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 22:29 Git bisect does not find commit introducing the bug Alex Hoffman
2017-02-17 23:21 ` Stephan Beyer
2017-02-18  9:12   ` Johannes Sixt
2017-02-18 11:15     ` Alex Hoffman
2017-02-18 14:18       ` Johannes Sixt
2017-02-18 18:36         ` Alex Hoffman
2017-02-18 19:58           ` Christian Couder
2017-02-19 11:32             ` Alex Hoffman
2017-02-19 12:43               ` Alex Hoffman
2017-02-19 13:07               ` Christian Couder
2017-02-19 14:13               ` Johannes Sixt
2017-02-19 19:05                 ` Alex Hoffman
2017-02-19 19:25                   ` Jacob Keller
2017-02-20  7:38                     ` Oleg Taranenko
2017-02-20 12:27                       ` Jakub Narębski
2017-02-20 13:50                         ` Oleg Taranenko
2017-02-20 20:31                           ` Alex Hoffman
2017-02-20 20:35                             ` Jakub Narębski
2017-02-20 20:39                               ` Alex Hoffman
2017-02-20 22:24                               ` Philip Oakley
2017-02-21 19:40                                 ` Alex Hoffman
2017-02-21 22:39                                   ` Philip Oakley
2017-02-20  9:02             ` Junio C Hamano [this message]
2017-02-18 22:10           ` Philip Oakley
2017-02-18 22:36           ` Hilco Wijbenga
2017-02-18 22:37           ` Johannes Sixt

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=xmqqy3x1jkuu.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=s-beyer@gmx.net \
    --cc=spec@gal.ro \
    /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).