git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Philip Oakley <philipoakley@iee.org>, Kevin Daudt <me@ikke.info>,
	git <git@vger.kernel.org>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v4] rev-list: refuse --first-parent combined with --bisect
Date: Wed, 18 Mar 2015 11:36:26 +0100	[thread overview]
Message-ID: <CAP8UFD3=w_7Mm-ew6HDWyK-x9uUTwcw=URNp+gNvfFXueAkgBg@mail.gmail.com> (raw)
In-Reply-To: <xmqq3853nyia.fsf@gitster.dls.corp.google.com>

On Tue, Mar 17, 2015 at 9:46 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian Couder <christian.couder@gmail.com> writes:
>
>> On Tue, Mar 17, 2015 at 7:33 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Christian Couder <christian.couder@gmail.com> writes:
>>>
>>>> Yes, but the user is supposed to not change the "bad" pointer for no
>>>> good reason.
>>>
>>> That is irrelevant, no?  Nobody is questioning that the user is
>>> supposed to judge if a commit is "good" or "bad" correctly.
>>
>> So if there is already a bad commit and the user gives another
>> bad commit, that means that the user knows that it will replace the
>> existing bad commit with the new one and that it's done for this
>> purpose.
>
> ECANNOTQUITEPARSE.  The user may say "git bisect bad $that" and we
> do not question $that is bad. Git does not know better than the
> user.
>
> But that does not mean Git does not know better than the user how
> the current bad commit and $that commit are related.  The user is
> not interested in "replacing" at all.  The user is telling just one
> single fact, that is, "$that is bad".

The user may make mistakes and try to fix them, like for example:

$ git checkout master
$ git bisect bad
$ git log --oneline --decorate --graph --all
# Ooops I was not on the right branch
$ git checkout dev
$ git bisect bad
$ git log --oneline --decorate --graph --all
# Everything looks ok now; the "bad" commit is what I expect
# I can properly continue bisecting using "git bisect good"...

In this case the user, who knows how git bisect works, expected that
the second "git bisect bad" would fix the previous mistake made using
the first "git bisect bad".

If we make "git bisect bad" behave in another way we may break an
advanced user's expectation.

>>> I am not quite sure if I am correctly getting what you meant to say,
>>> but if you meant "only when --alternate is given, we should do the
>>> merge-base thing; we should keep losing the current 'bad' and
>>> replace it with the new one without the --alternate option", I would
>>> see that as an exercise of a bad taste.
>>
>> What I wanted to say is that if we change "git bisect bad <commitish>",
>> so that now it means "add a new bad commit" instead of the previous
>> "replace the current bad commit, if any, with this one", then experienced
>> users might see that change as a regression in the user interface and
>> it might even break scripts.
>
> Huh?
>
> Step back a bit.  The place you need to start from is to admit the
> fact that what "git bisect bad <committish>" currently does is
> broken.
>
> Try creating this history yourself
>
>     a---b---c---d---e---f
>
> and start bisection this way:
>
>     $ git bisect start f c
>     $ git bisect bad a
>
> Immediately after the second command, "git bisect" moans
>
>     Some good revs are not ancestor of the bad rev.
>     git bisect cannot work properly in this case.
>     Maybe you mistake good and bad revs?
>
> when it notices that the good rev (i.e. 'c') is no longer an
> ancestor of the 'bad', which now points at 'a'.
>
> But that is because "git bisect bad" _blindly_ moved 'bad' that used
> to point at 'f' to 'a', making a good rev (i.e. 'c') an ancestor of
> the bad rev, without even bothering to check.

Yeah, "git bisect bad" currently does what it is asked and then
complains when it looks like a mistake has been made.

You might see that as a bug. I am seeing that more as "git bisect"
expecting users to know what they are doing.

For example an advanced user might have realized that the first "git
bisect start f c" was completely rubish for some reason, and the "git
bisect bad a" might be a first step to fix that. (The next step might
then be deleting the "good" pointer...)

> Now, if we fixed this bug and made the bisect_state function more
> careful (namely, when accepting "bad", make sure it is not beyond
> any existing "good", or barf like the above, _without_ moving the
> bad pointer), the user interface and behaviour would be changed.  Is
> that a regression?  No, it is a usability fix and a progress.

Yeah, you might see that as a usability fix and a progress.

> Simply put, bisect_state function can become more careful and
> intelligent to help users.

Yeah, we can try to help users more, but doing that we might annoy
some advanced users,  who are used to the current way "git bisect"
works, and perhaps break some scripts.

  reply	other threads:[~2015-03-18 10:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 14:19 [BUG] Segfault with rev-list --bisect Troy Moure
2015-03-04  5:33 ` Jeff King
2015-03-04 23:44 ` Junio C Hamano
2015-03-05  2:15   ` Troy Moure
2015-03-07 21:31   ` [PATCH] rev-list: refuse --first-parent combined with --bisect Kevin Daudt
2015-03-07 23:13     ` Kevin Daudt
2015-03-08  8:00       ` Junio C Hamano
2015-03-08 14:18     ` [PATCH v2] " Kevin Daudt
2015-03-08 15:02       ` [PATCH v3] " Kevin Daudt
2015-03-08 15:03       ` Kevin Daudt
2015-03-08 21:58         ` Eric Sunshine
2015-03-09 11:57           ` Kevin Daudt
2015-03-09 20:56         ` [PATCH v4] " Kevin Daudt
2015-03-10 22:09           ` Junio C Hamano
2015-03-10 22:55             ` Kevin Daudt
2015-03-10 23:12               ` Junio C Hamano
2015-03-11 18:45                 ` Kevin Daudt
2015-03-11 20:13                   ` Junio C Hamano
2015-03-16 16:33                     ` Kevin Daudt
2015-03-16 18:53                       ` Junio C Hamano
2015-03-16 20:25                         ` Philip Oakley
2015-03-16 21:05                           ` Junio C Hamano
2015-03-17 16:09                             ` Christian Couder
2015-03-17 18:33                               ` Junio C Hamano
2015-03-17 19:49                                 ` Christian Couder
2015-03-17 20:46                                   ` Junio C Hamano
2015-03-18 10:36                                     ` Christian Couder [this message]
2015-03-19 23:51                                 ` Philip Oakley
2015-03-20 13:02                         ` Scott Schmit
2015-03-19 22:14           ` [PATCH v5] " Kevin Daudt
2015-03-19 22:43             ` Junio C Hamano
2015-03-21 22:01               ` Kevin Daudt

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='CAP8UFD3=w_7Mm-ew6HDWyK-x9uUTwcw=URNp+gNvfFXueAkgBg@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ikke.info \
    --cc=philipoakley@iee.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.
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).