git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Torstein Hegge <hegge@resisty.net>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] bisect: Store first bad commit as comment in log file
Date: Mon, 15 Apr 2013 11:53:39 +0200	[thread overview]
Message-ID: <20130415095339.GA28480@pvv.ntnu.no> (raw)
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.

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

  reply	other threads:[~2013-04-15  9:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-13 15:22 [PATCH] bisect: Store first bad commit as comment in log file Torstein Hegge
2013-04-15  4:38 ` Christian Couder
2013-04-15  9:53   ` Torstein Hegge [this message]
2013-04-15 15:00     ` Junio C Hamano
2013-04-22 21:02     ` Torstein Hegge
2013-04-22 21:13       ` Junio C Hamano
2013-04-22 22:20         ` Torstein Hegge
2013-04-22 22:37           ` Junio C Hamano
2013-04-25  4:26           ` Christian Couder
2013-05-22 22:27       ` [PATCH] bisect: Fix log output for multi-parent skip ranges Torstein Hegge
2013-04-15  6:50 ` [PATCH] bisect: Store first bad commit as comment in log file Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130415095339.GA28480@pvv.ntnu.no \
    --to=hegge@resisty.net \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).