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

Re: [PATCH] bisect: improve output when bad commit is found

From
TSTrevor Saunders <tbsaunde@tbsaunde.org>
Date
May 12, 2015, 02:10 UTC
Message-ID
<20150512021024.GE18112@tsaunders-iceball.corp.tor1.mozilla.com>
In-Reply-To
<xmqqbnhq1r9t.fsf@gitster.dls.corp.google.com>
On Mon, May 11, 2015 at 07:08:46PM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> 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 :(
Show 13 quoted lines
> 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
Previous: Junio C Hamano
Message 5 of 5 in “bisect: improve output when bad commit is found”
  1. bisect: improve output when bad commit is foundTrevor Saunders, May 11, 2015
  2. Junio C HamanoMay 11, 2015
  3. Trevor SaundersMay 11, 2015
  4. Junio C HamanoMay 12, 2015
  5. Trevor SaundersMay 12, 2015

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.