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

Re: [PATCH] bisect: print abbrev sha1 for first bad commit

From
Jeff King <peff@peff.net>
Date
May 9, 2015, 04:07 UTC
Message-ID
<20150509040704.GA31428@peff.net>
In-Reply-To
<20150509014152.GA31119@tsaunders-iceball.corp.tor1.mozilla.com>
On Fri, May 08, 2015 at 10:03:41PM -0400, Trevor Saunders wrote:
Show 18 quoted lines
> On Fri, May 08, 2015 at 05:29:42PM -0700, Stefan Beller wrote:
> > On Fri, May 8, 2015 at 4:46 PM, Trevor Saunders <tbsaunde@tbsaunde.org> wrote:
> > > its rather silly especially considering the next line contains the
> > > full hash again.
> > 
> > Maybe we can omit it altogether then?
> 
> SO we'd print something like
> 
> the first bad commit is
> Commit abcdefabcdefabcdefabcdefabcdefabcdefabcd
> Author foo@ba.com
> 
> blah blah blah
> 
> ? That seems reasonable to me.  If we're going that far does it also
> make sense to drop printingthe lines about which trees have changed and
> just print the commit message / author / hash?

Yeah, I have always found bisect's output somewhat silly. It prints the "--raw" diff output, which is not incredibly useful. And then to top it off, it does not feed the "--recursive" switch to the diff, so you don't even get to see the real list of changed files.

I suspect the most minimal we could go is:
  git log --format='The first bad commit is %h %s' $bad

and then let the user inspect further from there using the hash. But I think it would also be reasonable to just do a straight "git log -1 $bad" with no with no diff.

(Actually, it looks like all this is generated in bisect.c:show_diff_tree, so it would have to be written in C; but it should be pretty easy to tweak the display options).

-Peff
Previous: Trevor SaundersNext: Trevor Saunders
Message 4 of 17 in “bisect: print abbrev sha1 for first bad commit”
  1. bisect: print abbrev sha1 for first bad commitTrevor Saunders, May 8, 2015
  2. Stefan BellerMay 9, 2015
  3. Trevor SaundersMay 9, 2015
  4. Jeff KingMay 9, 2015
  5. Trevor SaundersMay 10, 2015
  6. Jeff KingMay 11, 2015
  7. Junio C HamanoMay 11, 2015
  8. Christian CouderMay 11, 2015
  9. Junio C HamanoMay 11, 2015
  10. Trevor SaundersMay 11, 2015
  11. Stefan BellerMay 11, 2015
  12. Christian CouderMay 12, 2015
  13. Junio C HamanoMay 12, 2015
  14. Christian CouderMay 12, 2015
  15. Stefan BellerMay 12, 2015
  16. Trevor SaundersMay 12, 2015
  17. Christian CouderMay 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.