git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* should "git bisect" support "git bisect next?"
@ 2017-11-11 11:42 Robert P. J. Day
  2017-11-11 14:07 ` Christian Couder
  0 siblings, 1 reply; 11+ messages in thread
From: Robert P. J. Day @ 2017-11-11 11:42 UTC (permalink / raw)
  To: Git Mailing list


  the man page for "git bisect" makes no mention of "git bisect next",
but the script git-bisect.sh does:

#!/bin/sh

USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run]'
                                               ^^^^
LONG_USAGE='git bisect help
        print this long help message.
git bisect start [--term-{old,good}=<term> --term-{new,bad}=<term>]
                 [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]
        reset bisect state and start bisection.
git bisect (bad|new) [<rev>]
        mark <rev> a known-bad revision/
                a revision after change in a given property.
git bisect (good|old) [<rev>...]
        mark <rev>... known-good revisions/
                revisions before change in a given property.
git bisect terms [--term-good | --term-bad]
        show the terms used for old and new commits (default: bad, good)
git bisect skip [(<rev>|<range>)...]
        mark <rev>... untestable revisions.
git bisect next
        find next bisection to test and check it out.

  ... snip ...

case "$#" in
0)
        usage ;;
*)
        cmd="$1"
        get_terms
        shift
        case "$cmd" in
        help)
                git bisect -h ;;
        start)
                bisect_start "$@" ;;
        bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
                bisect_state "$cmd" "$@" ;;
        skip)
                bisect_skip "$@" ;;
        next)
                # Not sure we want "next" at the UI level anymore.
                bisect_next "$@" ;;

  ... snip ...

so, is it supported or not? should be consistent.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-11 11:42 should "git bisect" support "git bisect next?" Robert P. J. Day
@ 2017-11-11 14:07 ` Christian Couder
  2017-11-11 14:38   ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Couder @ 2017-11-11 14:07 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Git Mailing list, Stephan Beyer

On Sat, Nov 11, 2017 at 12:42 PM, Robert P. J. Day
<rpjday@crashcourse.ca> wrote:
>
>   the man page for "git bisect" makes no mention of "git bisect next",
> but the script git-bisect.sh does:

Yeah the following patch was related:

https://public-inbox.org/git/1460294354-7031-2-git-send-email-s-beyer@gmx.net/

You might want to discuss with Stephan (cc'ed).

Thanks,
Christian.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-11 14:07 ` Christian Couder
@ 2017-11-11 14:38   ` Junio C Hamano
  2017-11-11 19:46     ` Theodore Ts'o
  2017-11-12 20:08     ` Stephan Beyer
  0 siblings, 2 replies; 11+ messages in thread
From: Junio C Hamano @ 2017-11-11 14:38 UTC (permalink / raw)
  To: Christian Couder; +Cc: Robert P. J. Day, Git Mailing list, Stephan Beyer

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

> On Sat, Nov 11, 2017 at 12:42 PM, Robert P. J. Day
> <rpjday@crashcourse.ca> wrote:
>>
>>   the man page for "git bisect" makes no mention of "git bisect next",
>> but the script git-bisect.sh does:
>
> Yeah the following patch was related:
>
> https://public-inbox.org/git/1460294354-7031-2-git-send-email-s-beyer@gmx.net/
>
> You might want to discuss with Stephan (cc'ed).

Thanks for saving me time to explain why 'next' is still a very
important command but the end users do not actually need to be
strongly aware of it, because most commands automatically invokes it
as their final step due to the importance of what it does ;-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-11 14:38   ` Junio C Hamano
@ 2017-11-11 19:46     ` Theodore Ts'o
  2017-11-12  1:43       ` Junio C Hamano
  2017-11-12  9:17       ` Robert P. J. Day
  2017-11-12 20:08     ` Stephan Beyer
  1 sibling, 2 replies; 11+ messages in thread
From: Theodore Ts'o @ 2017-11-11 19:46 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Christian Couder, Robert P. J. Day, Git Mailing list, Stephan Beyer

On Sat, Nov 11, 2017 at 11:38:23PM +0900, Junio C Hamano wrote:
> 
> Thanks for saving me time to explain why 'next' is still a very
> important command but the end users do not actually need to be
> strongly aware of it, because most commands automatically invokes it
> as their final step due to the importance of what it does ;-)

This reminds me; is there a way to suppress it because I'm about to
give a large set of good and bit commits (perhaps because I'm
replaying part of a git biset log, minus one or two lines that are
suspected of being bogus thanks to flaky reproduction), and so there's
no point having git bisect figure the "next" commit to try until I'm
done giving it a list of good/bad commits?

	     	       	      	 	  - Ted

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-11 19:46     ` Theodore Ts'o
@ 2017-11-12  1:43       ` Junio C Hamano
  2017-11-12 14:21         ` Christian Couder
  2017-11-12  9:17       ` Robert P. J. Day
  1 sibling, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2017-11-12  1:43 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Christian Couder, Robert P. J. Day, Git Mailing list, Stephan Beyer

Theodore Ts'o <tytso@mit.edu> writes:

> On Sat, Nov 11, 2017 at 11:38:23PM +0900, Junio C Hamano wrote:
>> 
>> Thanks for saving me time to explain why 'next' is still a very
>> important command but the end users do not actually need to be
>> strongly aware of it, because most commands automatically invokes it
>> as their final step due to the importance of what it does ;-)
>
> This reminds me; is there a way to suppress it because I'm about to
> give a large set of good and bit commits (perhaps because I'm
> replaying part of a git biset log, minus one or two lines that are
> suspected of being bogus thanks to flaky reproduction), and so there's
> no point having git bisect figure the "next" commit to try until I'm
> done giving it a list of good/bad commits?

It is surprising that I've never heard of this idea, but I think
that it is an excellent one.

When the user knows what bad and good commits in what sequence will
be fed to the command (i.e. replaying a saved output of "git bisect
log"), ideally we would want to "plug" the auto-next processing, and
just mark good and bad in refs/bisect/* without doing anything other
than creating these refs, and then run a "next" before giving the
control back to present the final working tree to be tested by the
user.  That would save the cost of intermediate checkouts but also
the cost of extra merge-base computation that is done to catch the
case where the user gave a good commit that is an ancestor of a bad
commit by mistake.

I think that the output of "git bisect log" was designed to be just
an executable shell script that the user can edit (the edit is
mostly designed to make it possible: "I know I screwed up in this
step, so I change its 'bad' to 'good' and remove the remaining
lines") and just execute it.  Which makes the simplest approach that
would first come to my mind not work very well, unfortunately.

	The "simplest approach" would teach the "--no-autonext"
	option to "git bisect good" and "git bisect bad" and skip
	the call to bisect_auto_next in bisect_state when it is
	given.  Then update the output from "git bisect log" to add
	that option to all good/bad commands, and then add an
	explicit "git bisect next" at the end.  This won't work well
	because it is likely that with the "remove the remaining
	lines" step, it is likely that the user would remove the
	final "bisect next".

A workable alternative approach is to teach "git bisect replay" to
be more intelligent.  Right now, I do not think it does anything
more than what happens by an execution of the input file with a
shell, but "replay" should be able to read a single step ahead in
the command sequence while doing its step-by-step execution, and
when it notices that it is about to run "bisect good" or "bisect
bad", and if the command to be run after that is also one of these
two, it can decide to skip the auto-next processing in the current
step.  It shouldn't need any new "--no-auto-next" option (I am not
saying that adding the option is bad--in fact, I think it is a good
addition for expert users; I am just saying that the approach to
make "replay" smarter does not require it).

Christian, what do you think?  Am I missing something?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-11 19:46     ` Theodore Ts'o
  2017-11-12  1:43       ` Junio C Hamano
@ 2017-11-12  9:17       ` Robert P. J. Day
  2017-11-12  9:56         ` Junio C Hamano
  1 sibling, 1 reply; 11+ messages in thread
From: Robert P. J. Day @ 2017-11-12  9:17 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Junio C Hamano, Christian Couder, Git Mailing list, Stephan Beyer

On Sat, 11 Nov 2017, Theodore Ts'o wrote:

> On Sat, Nov 11, 2017 at 11:38:23PM +0900, Junio C Hamano wrote:
> >
> > Thanks for saving me time to explain why 'next' is still a very
> > important command but the end users do not actually need to be
> > strongly aware of it, because most commands automatically invokes
> > it as their final step due to the importance of what it does ;-)
>
> This reminds me; is there a way to suppress it because I'm about to
> give a large set of good and bit commits (perhaps because I'm
                      ^^^^^^^^^^^^^^^^^^^^
> replaying part of a git biset log, minus one or two lines that are
> suspected of being bogus thanks to flaky reproduction), and so
> there's no point having git bisect figure the "next" commit to try
> until I'm done giving it a list of good/bad commits?

  i'm sure i'll regret asking this, but (assuming "bit" should read
"bad") is this suggesting one can hand bisect more than one bad
commit? i thought we just went through that discussion where there
could be only one bad commit but multiple good commits. clarification?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-12  9:17       ` Robert P. J. Day
@ 2017-11-12  9:56         ` Junio C Hamano
  0 siblings, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2017-11-12  9:56 UTC (permalink / raw)
  To: Robert P. J. Day
  Cc: Theodore Ts'o, Christian Couder, Git Mailing list, Stephan Beyer

"Robert P. J. Day" <rpjday@crashcourse.ca> writes:

>> This reminds me; is there a way to suppress it because I'm about to
>> give a large set of good and bit commits (perhaps because I'm
>                       ^^^^^^^^^^^^^^^^^^^^
>> replaying part of a git biset log, minus one or two lines that are
>> suspected of being bogus thanks to flaky reproduction), and so
>> there's no point having git bisect figure the "next" commit to try
>> until I'm done giving it a list of good/bad commits?
>
>   i'm sure i'll regret asking this, but (assuming "bit" should read
> "bad") is this suggesting one can hand bisect more than one bad
> commit? i thought we just went through that discussion where there
> could be only one bad commit but multiple good commits. clarification?

The documentation you have been futzing with is about the fact that
the initial set of known to be good/bad commits that "git bisect
start <bad> <good>..." take can have one bad and zero or more good.

What is being discussed in this thread is different (and I tried to
clarify the fact by saying "what bad and good commits in what
sequence").  

Ted is talking about replaying the series of "git bisect (good|bad)
$a_single_commit" that are recorded during a bisection session and
can be read via "git bisect log".  When Ted says "good commits"
and/or "bad commits", he is not talking about giving all of them to
a single invocation of "git bisect" command.  The replay session
will take one commit at a time (which is what "git bisect replay"
does) and feed it to either "git bisect good" or "git bisect bad".

Does it make sense?

By the way, I do not think there is anything to regret in asking
what you do not understand.  Showing how much you know (and you
don't) will allow others who communicate with you to calibrate their
expectations, which eases later discussions; it is a good thing.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-12  1:43       ` Junio C Hamano
@ 2017-11-12 14:21         ` Christian Couder
  2017-11-12 18:42           ` Theodore Ts'o
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Couder @ 2017-11-12 14:21 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Theodore Ts'o, Robert P. J. Day, Git Mailing list, Stephan Beyer

On Sun, Nov 12, 2017 at 2:43 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Theodore Ts'o <tytso@mit.edu> writes:
>
>> On Sat, Nov 11, 2017 at 11:38:23PM +0900, Junio C Hamano wrote:
>>>
>>> Thanks for saving me time to explain why 'next' is still a very
>>> important command but the end users do not actually need to be
>>> strongly aware of it, because most commands automatically invokes it
>>> as their final step due to the importance of what it does ;-)
>>
>> This reminds me; is there a way to suppress it because I'm about to
>> give a large set of good and bit commits (perhaps because I'm
>> replaying part of a git biset log, minus one or two lines that are
>> suspected of being bogus thanks to flaky reproduction), and so there's
>> no point having git bisect figure the "next" commit to try until I'm
>> done giving it a list of good/bad commits?
>
> It is surprising that I've never heard of this idea, but I think
> that it is an excellent one.
>
> When the user knows what bad and good commits in what sequence will
> be fed to the command (i.e. replaying a saved output of "git bisect
> log"), ideally we would want to "plug" the auto-next processing, and
> just mark good and bad in refs/bisect/* without doing anything other
> than creating these refs, and then run a "next" before giving the
> control back to present the final working tree to be tested by the
> user.  That would save the cost of intermediate checkouts but also
> the cost of extra merge-base computation that is done to catch the
> case where the user gave a good commit that is an ancestor of a bad
> commit by mistake.

Yeah I agree that it might be something interesting for the user to do.
But in this case the sequence in which you give the good and the bad
commits is not important.
Only the last bad commit and the set of good commits that were given
are important.

If you can get that and pass it to 'git bisect start' then you will
avoid all the intermediate computation and actually start from the
state you want.

> I think that the output of "git bisect log" was designed to be just
> an executable shell script that the user can edit (the edit is
> mostly designed to make it possible: "I know I screwed up in this
> step, so I change its 'bad' to 'good' and remove the remaining
> lines") and just execute it.  Which makes the simplest approach that
> would first come to my mind not work very well, unfortunately.
>
>         The "simplest approach" would teach the "--no-autonext"
>         option to "git bisect good" and "git bisect bad" and skip
>         the call to bisect_auto_next in bisect_state when it is
>         given.  Then update the output from "git bisect log" to add
>         that option to all good/bad commands, and then add an
>         explicit "git bisect next" at the end.  This won't work well
>         because it is likely that with the "remove the remaining
>         lines" step, it is likely that the user would remove the
>         final "bisect next".
>
> A workable alternative approach is to teach "git bisect replay" to
> be more intelligent.  Right now, I do not think it does anything
> more than what happens by an execution of the input file with a
> shell, but "replay" should be able to read a single step ahead in
> the command sequence while doing its step-by-step execution, and
> when it notices that it is about to run "bisect good" or "bisect
> bad", and if the command to be run after that is also one of these
> two, it can decide to skip the auto-next processing in the current
> step.  It shouldn't need any new "--no-auto-next" option (I am not
> saying that adding the option is bad--in fact, I think it is a good
> addition for expert users; I am just saying that the approach to
> make "replay" smarter does not require it).

To automate that one could start with a dirty oneliner like this:

git bisect start $(git bisect log | perl -ne '$b = $1 if m/# bad:
\[(.*)\]/; push @g, $1 if m/# good: \[(.*)\]/; END { print $b . " ".
join(" ", @g) . "\n"; }')

So yeah we could add an option to "git replay" that would do that.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-12 14:21         ` Christian Couder
@ 2017-11-12 18:42           ` Theodore Ts'o
  2017-11-13  1:40             ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Theodore Ts'o @ 2017-11-12 18:42 UTC (permalink / raw)
  To: Christian Couder
  Cc: Junio C Hamano, Robert P. J. Day, Git Mailing list, Stephan Beyer

On Sun, Nov 12, 2017 at 03:21:57PM +0100, Christian Couder wrote:
> 
> Yeah I agree that it might be something interesting for the user to do.
> But in this case the sequence in which you give the good and the bad
> commits is not important.
> Only the last bad commit and the set of good commits that were given
> are important.

Is it really true that of the bad commits, only the last one is significant?

Suppose we have a git tree that looks like this:

          *---*---*---*---*---*---M2---*---B1
          |                        |
  G1--*--D1---*---*---*---B2-\     |
          |                   \    /
          *---*---*---B3--*---M1--/

If we know that commits B2 and B3 are bad, if we assume that all
commits before the "bad" commit are good, all commits after the "bad"
commit are bad, can we not deduce that commit D1 should also be "bad"?

       	   	       	   	       	      - Ted

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-11 14:38   ` Junio C Hamano
  2017-11-11 19:46     ` Theodore Ts'o
@ 2017-11-12 20:08     ` Stephan Beyer
  1 sibling, 0 replies; 11+ messages in thread
From: Stephan Beyer @ 2017-11-12 20:08 UTC (permalink / raw)
  To: Junio C Hamano, Christian Couder
  Cc: Robert P. J. Day, Git Mailing list, Pranit Bauva

Hi,

On 11/11/2017 03:38 PM, Junio C Hamano wrote:
> Christian Couder <christian.couder@gmail.com> writes:
> 
>> On Sat, Nov 11, 2017 at 12:42 PM, Robert P. J. Day
>> <rpjday@crashcourse.ca> wrote:
>>>
>>>   the man page for "git bisect" makes no mention of "git bisect next",
>>> but the script git-bisect.sh does:
>>
>> Yeah the following patch was related:
>>
>> https://public-inbox.org/git/1460294354-7031-2-git-send-email-s-beyer@gmx.net/
>>
>> You might want to discuss with Stephan (cc'ed).
> 
> Thanks for saving me time to explain why 'next' is still a very
> important command but the end users do not actually need to be
> strongly aware of it, because most commands automatically invokes it
> as their final step due to the importance of what it does ;-)

I will nonetheless re-roll the patch (that Christian linked to)
after Pranit's bisect part II series is in good shape. I think the
documentation change in the patch shows why the user should be aware of
it (although not strongly).

Best
Stephan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: should "git bisect" support "git bisect next?"
  2017-11-12 18:42           ` Theodore Ts'o
@ 2017-11-13  1:40             ` Junio C Hamano
  0 siblings, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2017-11-13  1:40 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Christian Couder, Robert P. J. Day, Git Mailing list, Stephan Beyer

Theodore Ts'o <tytso@mit.edu> writes:

> On Sun, Nov 12, 2017 at 03:21:57PM +0100, Christian Couder wrote:
>> 
>> Yeah I agree that it might be something interesting for the user to do.
>> But in this case the sequence in which you give the good and the bad
>> commits is not important.
>> Only the last bad commit and the set of good commits that were given
>> are important.
>
> Is it really true that of the bad commits, only the last one is significant?
>
> Suppose we have a git tree that looks like this:
>
>           *---*---*---*---*---*---M2---*---B1
>           |                        |
>   G1--*--D1---*---*---*---B2-\     |
>           |                   \    /
>           *---*---*---B3--*---M1--/
>
> If we know that commits B2 and B3 are bad, if we assume that all
> commits before the "bad" commit are good, all commits after the "bad"
> commit are bad, can we not deduce that commit D1 should also be "bad"?

You are correct.  Christian fell into an understandable and common
confusion.  It is true that we only maintain one significant bad
(i.e. the breakage that is known-ealiest so far), but that oldest
bad is the result of the bisection taking into account all the 'bad'
we have got in sequence so far, not necessarily the same as, and
hopefully way better than, the last bad the user gave from the
command line.  In your topology, "git bisect log" would contain "bad
B1", "bad B2", and "bad B3", and when the earlier session that
produced that log saw these three bad commits, it would have marked
D1 as the known-earliest bad one.

Taking the last-given bad B3 is suboptimal than that.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-11-13  1:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-11 11:42 should "git bisect" support "git bisect next?" Robert P. J. Day
2017-11-11 14:07 ` Christian Couder
2017-11-11 14:38   ` Junio C Hamano
2017-11-11 19:46     ` Theodore Ts'o
2017-11-12  1:43       ` Junio C Hamano
2017-11-12 14:21         ` Christian Couder
2017-11-12 18:42           ` Theodore Ts'o
2017-11-13  1:40             ` Junio C Hamano
2017-11-12  9:17       ` Robert P. J. Day
2017-11-12  9:56         ` Junio C Hamano
2017-11-12 20:08     ` Stephan Beyer

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git