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

Re: git-visualize(1) plumbing equivalent

From
ACAlejandro Colomar <alx@kernel.org>
Date
Oct 3, 2026, 17:50 UTC
Message-ID
<asFAEwomFDbC2Dec@debian>
In-Reply-To
<CALnO6CAsd36-XEnRQWNhAsmH7Bg6ZoHv7qb2xQ1m0cW4-Decmw@mail.gmail.com>
Hi Ben,
Show 43 quoted lines
> Date: 2026-10-03 13:10:43-0400
> From: "D. Ben Knoble" <ben.knoble@gmail.com>
>
> On Sat, Oct 3, 2026 at 11:13 AM Alejandro Colomar <alx@kernel.org> wrote:
> >
> > Hi Ben,
> >
> > > Date: 2026-10-03 09:45:17-0400
> > > From: "D. Ben Knoble" <ben.knoble@gmail.com>
> > >
> > > On Sat, Oct 3, 2026 at 6:13 AM Alejandro Colomar <alx@kernel.org> wrote:
> 
> [snip]
> 
> > > > Having read the documentation for git-bisect(1), visualize reads several
> > > > environment variables, and thus this code doesn't seem robust.  What
> > > > would be the plumbing version of the while-loop condition?
> > > >
> > > >                 git bisect visualize --oneline \
> > > >                 | wc -l \
> > > >                 | xargs -I{} test {} -gt 1;
> > > >
> > > > The goal is to know whether git-bisect(1) has found a commit yet or not,
> > > > to stop looping.
> > >
> > > I think you are probably looking for the (size of the) set of commits
> > > between bisect/bad and all the bisect/good-* refs. So you might need
> > > to "git refs list" the good ones, and feed those as negated refs
> > > alongside bisect/bad to rev-list?
> >
> > Yup, this seems to work:
> >
> > git refs list | grep refs/bisect/ | sed '/good/s/^/^/' | cut -f1 -d' ' | xargs git rev-list
> >
> > >
> > > In the general case, that wouldn't account for skipped commits as I
> > > understand it, where multiple commits are left at the end of the
> > > bisect, but in your script it doesn't look like you skip any.
> >
> > Hmmmm.  I'm now working on adding the ability to skip commits, so this
> > would be a problem.  Do you have any idea on how to deal with that?
> 
> Not offhand, sorry :/ I'm not totally sure how bisect represents that state.

Thanks anyway! I think this is getting hard enough, that it might be worth piping a heredocument into a mktemp(1) file within the script, and passing that to 'git bisect run'.

Cheers, Alex

-- 
<https://www.alejandro-colomar.es>
Previous: D. Ben Knoble
Message 7 of 7 in “git-visualize(1) plumbing equivalent”
  1. Alejandro ColomarOct 3, 2026
  2. D. Ben KnobleOct 3, 2026
  3. Alejandro ColomarOct 3, 2026
  4. Kristoffer HaugsbakkOct 3, 2026
  5. D. Ben KnobleOct 3, 2026
  6. D. Ben KnobleOct 3, 2026
  7. Alejandro ColomarOct 3, 2026

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.