git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* "git bisect" takes exactly one bad commit and one or more good?
@ 2017-11-11 11:22 Robert P. J. Day
  2017-11-11 12:01 ` Christian Couder
  0 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2017-11-11 11:22 UTC (permalink / raw)
  To: Git Mailing list


  more on "git bisect" ... the man page seems to make it clear that
bisection takes *precisely* one "bad" commit, and one *or more* good
commits, is that correct? seems that way, given the ellipses in the
commands below:

  git bisect start [--term-{old,good}=<term> --term-{new,bad}=<term>]
                   [--no-checkout] [<bad> [<good>...]] [--] [<paths>...]
  git bisect (bad|new|<term-new>) [<rev>]
  git bisect (good|old|<term-old>) [<rev>...]

however, other parts of the man page seem less clear. just below
that, a description that bisection takes "a" good commit:

"You use it by first telling it a "bad" commit that is known to
contain the bug, and a "good" commit that is known to be before the
bug was introduced."

and a bit lower, we read "at least one bad ...", which some people
might interpret as one or more *bad* commits:

"Once you have specified at least one bad and one good commit, git
bisect selects a commit in the middle of that range of history, checks
it out, and outputs something similar to the following:"

  if the rules are exactly one bad commit and one or more good, i'll
submit a patch to reword at least the above, and possibly more if
necessary.

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] 7+ messages in thread

* Re: "git bisect" takes exactly one bad commit and one or more good?
  2017-11-11 11:22 "git bisect" takes exactly one bad commit and one or more good? Robert P. J. Day
@ 2017-11-11 12:01 ` Christian Couder
  2017-11-11 14:34   ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Couder @ 2017-11-11 12:01 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Git Mailing list

On Sat, Nov 11, 2017 at 12:22 PM, Robert P. J. Day
<rpjday@crashcourse.ca> wrote:
>
>   more on "git bisect" ... the man page seems to make it clear that
> bisection takes *precisely* one "bad" commit, and one *or more* good
> commits, is that correct?

Yeah, that's true.

> seems that way, given the ellipses in the
> commands below:
>
>   git bisect start [--term-{old,good}=<term> --term-{new,bad}=<term>]
>                    [--no-checkout] [<bad> [<good>...]] [--] [<paths>...]
>   git bisect (bad|new|<term-new>) [<rev>]
>   git bisect (good|old|<term-old>) [<rev>...]

Yeah indeed.

> however, other parts of the man page seem less clear. just below
> that, a description that bisection takes "a" good commit:
>
> "You use it by first telling it a "bad" commit that is known to
> contain the bug, and a "good" commit that is known to be before the
> bug was introduced."

Yeah, 'and at least a "good" commit' would be better.

> and a bit lower, we read "at least one bad ...", which some people
> might interpret as one or more *bad* commits:
>
> "Once you have specified at least one bad and one good commit, git
> bisect selects a commit in the middle of that range of history, checks
> it out, and outputs something similar to the following:"

Yeah, 'Once you have specified one bad and at least one good commit'
would be better.

>   if the rules are exactly one bad commit and one or more good, i'll
> submit a patch to reword at least the above, and possibly more if
> necessary.

Sure, thanks,
Christian.

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

* Re: "git bisect" takes exactly one bad commit and one or more good?
  2017-11-11 12:01 ` Christian Couder
@ 2017-11-11 14:34   ` Junio C Hamano
  2017-11-11 15:27     ` Robert P. J. Day
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Junio C Hamano @ 2017-11-11 14:34 UTC (permalink / raw)
  To: Christian Couder; +Cc: Robert P. J. Day, Git Mailing list

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

>> "You use it by first telling it a "bad" commit that is known to
>> contain the bug, and a "good" commit that is known to be before the
>> bug was introduced."
>
> Yeah, 'and at least a "good" commit' would be better.

Make it "at least one" instead, perhaps?

I somehow thought that you technically could force bisection with 0
good commit, even though no sane person would do so.  For the
matter, in practice nobody starts with more than one good commit,
and for that reason, I doubt that the proposed change to overstress
the fact that you could give two or more "good" ones when starting
has that much practical value.  The tradeoff of losing the clarity
coming from giving only the simplest usage pattern for trying to be
technically more correct that is proposed by this change does not
sound too good, but it may be just me (who prefers white lies in the
end-user docs when it buys us more simplicity and clarity).
.


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

* Re: "git bisect" takes exactly one bad commit and one or more good?
  2017-11-11 14:34   ` Junio C Hamano
@ 2017-11-11 15:27     ` Robert P. J. Day
  2017-11-12 12:14       ` Kaartic Sivaraam
  2017-11-11 16:03     ` Robert P. J. Day
  2017-11-12 21:13     ` Stephan Beyer
  2 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2017-11-11 15:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Christian Couder, Git Mailing list

On Sat, 11 Nov 2017, Junio C Hamano wrote:

> Christian Couder <christian.couder@gmail.com> writes:
>
> >> "You use it by first telling it a "bad" commit that is known to
> >> contain the bug, and a "good" commit that is known to be before
> >> the bug was introduced."
> >
> > Yeah, 'and at least a "good" commit' would be better.
>
> Make it "at least one" instead, perhaps?
>
> I somehow thought that you technically could force bisection with 0
> good commit, even though no sane person would do so.  For the
> matter, in practice nobody starts with more than one good commit,
> and for that reason, I doubt that the proposed change to overstress
> the fact that you could give two or more "good" ones when starting
> has that much practical value.  The tradeoff of losing the clarity
> coming from giving only the simplest usage pattern for trying to be
> technically more correct that is proposed by this change does not
> sound too good, but it may be just me (who prefers white lies in the
> end-user docs when it buys us more simplicity and clarity). .

  i realize that one of each commit is the simplest use case, but the
scenario that occurred to me is a bunch of branches being merged and,
suddenly, you have a bug, and you're not sure where it came from so
you identify a number of good commits, one per merged branch, and go
from there.

  also, making it clear you can have more than one good commit is
consistent with the synopses, which use ellipses to represent that
very thing.

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] 7+ messages in thread

* Re: "git bisect" takes exactly one bad commit and one or more good?
  2017-11-11 14:34   ` Junio C Hamano
  2017-11-11 15:27     ` Robert P. J. Day
@ 2017-11-11 16:03     ` Robert P. J. Day
  2017-11-12 21:13     ` Stephan Beyer
  2 siblings, 0 replies; 7+ messages in thread
From: Robert P. J. Day @ 2017-11-11 16:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Christian Couder, Git Mailing list

On Sat, 11 Nov 2017, Junio C Hamano wrote:

> Christian Couder <christian.couder@gmail.com> writes:
>
> >> "You use it by first telling it a "bad" commit that is known to
> >> contain the bug, and a "good" commit that is known to be before the
> >> bug was introduced."
> >
> > Yeah, 'and at least a "good" commit' would be better.
>
> Make it "at least one" instead, perhaps?
>
> I somehow thought that you technically could force bisection with 0
> good commit, even though no sane person would do so...

  i do see the following snippet in bisect_next_check():

  bisect_next_check() {

  ... snip ...

        case "$missing_good,$missing_bad,$1" in
        ,,*)
                : have both $TERM_GOOD and $TERM_BAD - ok
                ;;
        *,)
                # do not have both but not asked to fail - just report.
                false
                ;;
        t,,"$TERM_GOOD")
                # have bad (or new) but not good (or old).  we could bisect although
                # this is less optimum.
                eval_gettextln "Warning: bisecting only with a \$TERM_BAD commit." >&2

  ... snip ...

so i guess it's possible.

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] 7+ messages in thread

* Re: "git bisect" takes exactly one bad commit and one or more good?
  2017-11-11 15:27     ` Robert P. J. Day
@ 2017-11-12 12:14       ` Kaartic Sivaraam
  0 siblings, 0 replies; 7+ messages in thread
From: Kaartic Sivaraam @ 2017-11-12 12:14 UTC (permalink / raw)
  To: Robert P. J. Day, Junio C Hamano; +Cc: Christian Couder, Git Mailing list

On Sat, 2017-11-11 at 10:27 -0500, Robert P. J. Day wrote:
> 
>   i realize that one of each commit is the simplest use case, but the
> scenario that occurred to me is a bunch of branches being merged and,
> suddenly, you have a bug, and you're not sure where it came from so
> you identify a number of good commits, one per merged branch, and go
> from there.
> 
> 

Just thinking out loud, couldn't you give the one commit that was the
tip of the branch, to which you merged the branches, before you merged
in the branches as the good commit ?


-- 
Kaartic

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

* Re: "git bisect" takes exactly one bad commit and one or more good?
  2017-11-11 14:34   ` Junio C Hamano
  2017-11-11 15:27     ` Robert P. J. Day
  2017-11-11 16:03     ` Robert P. J. Day
@ 2017-11-12 21:13     ` Stephan Beyer
  2 siblings, 0 replies; 7+ messages in thread
From: Stephan Beyer @ 2017-11-12 21:13 UTC (permalink / raw)
  To: Junio C Hamano, Christian Couder; +Cc: Robert P. J. Day, Git Mailing list

On 11/11/2017 03:34 PM, Junio C Hamano wrote:
> Christian Couder <christian.couder@gmail.com> writes:
> 
>>> "You use it by first telling it a "bad" commit that is known to
>>> contain the bug, and a "good" commit that is known to be before the
>>> bug was introduced."
>>
>> Yeah, 'and at least a "good" commit' would be better.
> 
> Make it "at least one" instead, perhaps?
> 
> I somehow thought that you technically could force bisection with 0
> good commit, even though no sane person would do so.

Thanks for pointing that out but I disagree with the part after "even
though" :)

Imagine you add a test case that was totally uncovered before and now
reveals a bug. You want to find the introduction of the bug, so you can
either check out the first commit you think where that bug did not
exist, then you find out that its also a bad commit, so you check out
another commit... essentially you are manually doing a "bisect" but less
efficient. So it would be better to let "git bisect" do its job without
knowing a good commit in advance. Sounds perfectly sane to me.

The probably insane thing is that there are currently performance issues
with git bisect. So you *are* probably faster by guessing. But that is
what my patch series [1] was about (and that I postponed in favor of
other conflicting work on bisect).

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

Cheers
Stephan

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

end of thread, other threads:[~2017-11-12 21:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-11 11:22 "git bisect" takes exactly one bad commit and one or more good? Robert P. J. Day
2017-11-11 12:01 ` Christian Couder
2017-11-11 14:34   ` Junio C Hamano
2017-11-11 15:27     ` Robert P. J. Day
2017-11-12 12:14       ` Kaartic Sivaraam
2017-11-11 16:03     ` Robert P. J. Day
2017-11-12 21:13     ` 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