Re: "git bisect" takes exactly one bad commit and one or more good?

2017-11-12 Thread Stephan Beyer
On 11/11/2017 03:34 PM, Junio C Hamano wrote:
> Christian Couder  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-be...@gmx.net/

Cheers
Stephan


Re: "git bisect" takes exactly one bad commit and one or more good?

2017-11-12 Thread Kaartic Sivaraam
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


Re: "git bisect" takes exactly one bad commit and one or more good?

2017-11-11 Thread Robert P. J. Day
On Sat, 11 Nov 2017, Junio C Hamano wrote:

> Christian Couder  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



Re: "git bisect" takes exactly one bad commit and one or more good?

2017-11-11 Thread Robert P. J. Day
On Sat, 11 Nov 2017, Junio C Hamano wrote:

> Christian Couder  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



Re: "git bisect" takes exactly one bad commit and one or more good?

2017-11-11 Thread Junio C Hamano
Christian Couder  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).
.



Re: "git bisect" takes exactly one bad commit and one or more good?

2017-11-11 Thread Christian Couder
On Sat, Nov 11, 2017 at 12:22 PM, Robert P. J. Day
 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-{new,bad}=]
>[--no-checkout] [ [...]] [--] [...]
>   git bisect (bad|new|) []
>   git bisect (good|old|) [...]

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.