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

Re: [PATCH] bisect: Store first bad commit as comment in log file

From
Torstein Hegge <hegge@resisty.net>
Date
Apr 15, 2013, 09:53 UTC
Message-ID
<20130415095339.GA28480@pvv.ntnu.no>
In-Reply-To
<20130415.063809.1055555229072260139.chriscool@tuxfamily.org>
On Mon, Apr 15, 2013 at 06:38:09 +0200, Christian Couder wrote:
> I wonder if we should also write something into the bisect log if for
> example the bisection stopped because there are only 'skip'ped commits
> left to test. But maybe this could go into another patch after this
> one.

Yes, that would be useful, but I wasn't able to determine all the cases that would be relevant to log. Only skipped commits left to test is one, but bisect--helper also exits on various problems related to merge base handling. The handling of problems related to inconsistent user input is probably not relevant to log.

I think the successful bisect case is most important to log and the one that requires the least amount of invasive changes.

Show 15 quoted lines
> > diff --git a/git-bisect.sh b/git-bisect.sh
> > index 99efbe8..c58eea7 100755
> > --- a/git-bisect.sh
> > +++ b/git-bisect.sh
> > @@ -311,7 +311,13 @@ bisect_next() {
> >  	res=$?
> >  
> >  	# Check if we should exit because bisection is finished
> > -	test $res -eq 10 && exit 0
> > +	if test $res -eq 10
> > +	then
> > +		bad_rev=$(git show-ref --hash --verify refs/bisect/bad)
> 
> I had a look to make sure that refs/bisect/bad always refered to the
> first bad commit at this point, and it is true indeed.

According to Documentation/git-bisect.txt, refs/bisect/bad is the proper way to determine the first bad commit at the end of a bisection.

> Maybe you could have used "git rev-parse --verify" instead of "git
> show-ref --hash --verify". It looks simpler to me.

I was wondering why "git grep show-ref *.sh" gave so few users. It looks like rev-parse is more common.

> And maybe, just in case, you could have added: || die "$(gettext "Bad rev: refs/bisect/bad")"
Yes, I should probably have done that.
> Otherwise this patch looks good to me.
Thanks.
Torstein
Previous: Christian CouderNext: Junio C Hamano
Message 3 of 11 in “bisect: Store first bad commit as comment in log file”
  1. bisect: Store first bad commit as comment in log fileTorstein Hegge, Apr 13, 2013
  2. Christian CouderApr 15, 2013
  3. Torstein HeggeApr 15, 2013
  4. Junio C HamanoApr 15, 2013
  5. Torstein HeggeApr 22, 2013
  6. Junio C HamanoApr 22, 2013
  7. Torstein HeggeApr 22, 2013
  8. Junio C HamanoApr 22, 2013
  9. Christian CouderApr 25, 2013
  10. bisect: Fix log output for multi-parent skip rangesTorstein Hegge, May 22, 2013
  11. Junio C HamanoApr 15, 2013

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.