All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trevor Saunders <tbsaunde@tbsaunde.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] bisect: improve output when bad commit is found
Date: Mon, 11 May 2015 22:10:24 -0400	[thread overview]
Message-ID: <20150512021024.GE18112@tsaunders-iceball.corp.tor1.mozilla.com> (raw)
In-Reply-To: <xmqqbnhq1r9t.fsf@gitster.dls.corp.google.com>

On Mon, May 11, 2015 at 07:08:46PM -0700, Junio C Hamano wrote:
> Trevor Saunders <tbsaunde@tbsaunde.org> writes:
> 
> >> > +	file=$1
> >> > +	hash=$2
> >> > +	grep "the first bad commit is" $file || return $?
> >> > +	grep $hash $file || return $?
> >> 
> >> Is it OK to have these strings anywhere in the $file?
> >
> > Its not great, but the test seems to log multiple invokations of git
> > bisect into the same file, so there may be text about previous runs
> > before we are told which commit is bad.
> 
> So if we had a previous entry that happens to match $hash, even if
> the current test stopped and pointed at a different thing, this test
> declares a success?

err yeah, didn't think of that :(

> This function knows how the $file should end, so it might be more
> sensible to craft the expected output and compare the tail end of
> the $file with it, something like:
> 
> 	(
> 		echo "The first bad commit is"
>                 git show -s "$hash"
> 	) >expect &&
>         cnt=$(wc -l <expect) &&
>         tail -n $cnt "$file" >actual &&
>         test_cmp expect actual
> 
> perhaps?

seems about right.

Thanks!

Trev

      reply	other threads:[~2015-05-12  2:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 20:58 [PATCH] bisect: improve output when bad commit is found Trevor Saunders
2015-05-11 21:12 ` Junio C Hamano
2015-05-11 23:11   ` Trevor Saunders
2015-05-12  2:08     ` Junio C Hamano
2015-05-12  2:10       ` Trevor Saunders [this message]

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=20150512021024.GE18112@tsaunders-iceball.corp.tor1.mozilla.com \
    --to=tbsaunde@tbsaunde.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.