git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 6/7] Bisect: factorise "bisect_{bad,good,dunno}" into "bisect_state".

From
Christian Couder <chriscool@tuxfamily.org>
Date
Oct 15, 2007, 03:42 UTC
Message-ID
<200710150542.17667.chriscool@tuxfamily.org>
In-Reply-To
<Pine.LNX.4.64.0710141710230.25221@racer.site>
Le dimanche 14 octobre 2007, Johannes Schindelin a écrit :
Show 25 quoted lines
> Hi,
>
> On Sun, 14 Oct 2007, Christian Couder wrote:
> > -bisect_bad() {
> > +bisect_state() {
> >  	bisect_autostart
> > -	case "$#" in
> > -	0)
> > -		rev=$(git rev-parse --verify HEAD) ;;
> > -	1)
> > -		rev=$(git rev-parse --verify "$1^{commit}") ;;
> > +	state=$1
> > +	case "$#,$state" in
> > +	0,*)
> > +		die "Please call 'bisect_state' with at least one argument." ;;
> > +	1,bad|1,good|1,dunno)
> > +		rev=$(git rev-parse --verify HEAD) ||
> > +			die "Bad rev input: HEAD"
> > +		bisect_write "$state" "$rev" ;;
> > +	2,bad)
> > +		rev=$(git rev-parse --verify "$2^{commit}") ||
> > +			die "Bad rev input: $2"
> > +		bisect_write "$state" "$rev" ;;
>
> Really?  As far as I see, "2,bad" is an error in the current bisect.

But the new "bisect_state" takes one more argument, because the first one must be "good" "bad" or "dunno".

So when there is only one argument HEAD is used, and when there are 2 arguments, $2 is used as the good|bad|dunno rev.

Show 17 quoted lines
> > @@ -404,17 +390,15 @@ bisect_run () {
> >  	  exit $res
> >        fi
> >
> > -      # Use "bisect_good" or "bisect_bad"
> > -      # depending on run success or failure.
> > +      # Find current state depending on run success or failure.
> >        if [ $res -gt 0 ]; then
> > -	  next_bisect='bisect_bad'
> > +	  state='bad'
> >        else
> > -	  next_bisect='bisect_good'
> > +	  state='good'
> >        fi
>
> Maybe it is time to have a special exit status for "dunno"?  But this is
> not something to fix in your patch, just an idea for a future patch.
Yes, I will think about it.

Thanks, Christian.

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 6 in “Bisect: factorise "bisect_{bad,good,dunno}" into "bisect_state".”
  1. 6/7 Bisect: factorise "bisect_{bad,good,dunno}" into "bisect_state".Christian Couder, Oct 14, 2007
  2. Johannes SchindelinOct 14, 2007
  3. Christian CouderOct 15, 2007
  4. Johannes SchindelinOct 15, 2007
  5. Christian CouderOct 16, 2007
  6. Johannes SchindelinOct 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.