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

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

From
Jeff King <peff@peff.net>
Date
May 13, 2015, 01:36 UTC
Message-ID
<20150513013637.GB3066@peff.net>
In-Reply-To
<xmqqoalpcm9f.fsf@gitster.dls.corp.google.com>
On Tue, May 12, 2015 at 06:13:48PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> >> See $gmane/268881
> >
> > Well, technically he just said it might be that people are parsing the
> > output and could be broken, but if you'd rather not take that risk then
> > I guess we just have to leave things the way they are.
> 
> FWIW.
> 
>  - I personally do not agree that those who scripted around "git
>    bisect" (as opposed to those who wrote scripts to be driven by
>    the "bisect run" interface) are worth worrying about.  But I am
>    not the whole of the Git world ;-)

It is not clear to me that people are actually scripting around the output. Between the exit code and the stable output in BISECT_LOG, that seems like a much more preferable way for scripted uses to find out what happened.

Of course, that is not a guarantee that nobody scraped stderr, but at least it makes me feel better that they're Doing It Wrong. :)

It would be nice if we had some actual data points. I followed the link Christian gave to Ingo's old post, but I didn't see the actual script there. There is:

  https://github.com/grosser/git-autobisect/blob/master/lib/git/autobisect.rb
which does seem to scrape stderr. Bleh.
Show 11 quoted lines
>  - I _do_ think diff-tree --raw output without recursive is silly.
>    It is not useful for humans (it doesn't even give paths fully),
>    and it is insufficient for scripts, which can grok more through
>    information out of the 40-hex.
> 
> So perhaps if we keep
> 
> 	<40 char sha1> is the first bad commit
> 
> and then replace the diff-tree output with "show -s", then the
> result would be good enough, I would say.

That seems like a reasonable first step, at the very least. I wonder if we should also better document the exit code and BISECT_LOG semantics, and explicitly tell people not to scrape stderr. That at least frees us up later to change the output as we see fit (I notice that most of the messages in the script are already i18n'd; the ones from bisect--helper are the odd ones out).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 10 in “bisect: improve output when bad commit is found”
  1. bisect: improve output when bad commit is foundTrevor Saunders, May 12, 2015
  2. Junio C HamanoMay 12, 2015
  3. Trevor SaundersMay 13, 2015
  4. Junio C HamanoMay 13, 2015
  5. Jeff KingMay 13, 2015
  6. Junio C HamanoMay 13, 2015
  7. Christian CouderMay 13, 2015
  8. Jeff KingMay 13, 2015
  9. Christian CouderMay 13, 2015
  10. Trevor SaundersMay 13, 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.