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

Re: [PATCH v4 5/6] bisect--helper: reimplement `bisect_run` shell function in C

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 17, 2021, 21:36 UTC
Message-ID
<nycvar.QRO.7.76.6.2108172332050.55@tvgsbejvaqbjf.bet>
In-Reply-To
<CAN7CjDDEv6vGPKZo3sxz8bgfN2Nzqh0HChR-tGrjDGbkhKZo=A@mail.gmail.com>
Hi Miriam,
On Tue, 17 Aug 2021, Miriam R. wrote:
Show 42 quoted lines
> El mar, 17 ago 2021 a las 13:42, Johannes Schindelin
> (<Johannes.Schindelin@gmx.de>) escribió:
> >
> > On Tue, 17 Aug 2021, Miriam Rubio wrote:
> >
> > > From: Tanushree Tumane <tanushreetumane@gmail.com>
> > >
> > > [...]
> > > +
> > > +             if (res == 125)
> > > +                     strvec_push(&args, "skip");
> > > +             else if (res > 0)
> > > +                     strvec_push(&args, terms->term_bad);
> > > +             else
> > > +                     strvec_push(&args, terms->term_good);
> > > +
> > > +             res = bisect_state(terms, args.v, args.nr);
> >
> > Since `args.nr` will always be 1, it would probably be better to use
> > something like this:
> >
> >                 const char *new_state;
> >
> >                 [...]
> >                 if (res == 125)
> >                         new_state = "skip";
> >                 else
> >                         new_state = res > 0 ?
> >                                 terms->term_bad : terms->term_good;
> >
> >                 res = bisect_state(terms, &new_state, 1);
> >
>
> Yes, indeed. I will change it.
>
> > Also: I think at this stage, an equivalent to `cat
> > "$GIT_DIR/BISECT_RUN"` is missing.
>
> In the previous patch series (v3), I implemented the equivalent to the
> cat command but I understood reviewers wanted to print the output to the
> user, so I reverted my changes for this version.
> https://lore.kernel.org/git/20210411095538.34129-4-mirucam@gmail.com/

I am a bit confused: doesn't `bisect_state()` write to the `BISECT_RUN` file? If so, I think we do need to show the contents by opening the file and piping it to `stdout`.

FWIW I read https://lore.kernel.org/git/CAP8UFD3X24F3qgefHpi00PM-KUk+vcqxwy2Dbngbyj7ciavCVQ@mail.gmail.com/ to mean the same thing, although I have to admit that I am not 100% certain.

Just to make sure: with this patch, at the end of a `git bisect` run, the user is shown the commit message of the first bad commit?

Ciao, Dscho

Previous: Miriam R.Next: Christian Couder
Message 16 of 20 in “Finish converting git bisect to C part 4”
  1. 0/6 Finish converting git bisect to C part 4Miriam Rubio, Aug 17, 2021
  2. 1/6 t6030-bisect-porcelain: add tests to control bisect run exit casesMiriam Rubio, Aug 17, 2021
  3. Bagas SanjayaAug 17, 2021
  4. Christian CouderAug 17, 2021
  5. Miriam R.Aug 17, 2021
  6. 2/6 t6030-bisect-porcelain: add test for bisect visualizeMiriam Rubio, Aug 17, 2021
  7. Bagas SanjayaAug 17, 2021
  8. Miriam R.Aug 17, 2021
  9. 3/6 run-command: make `exists_in_PATH()` non-staticMiriam Rubio, Aug 17, 2021
  10. 4/6 bisect--helper: reimplement `bisect_visualize()`shell function in CMiriam Rubio, Aug 17, 2021
  11. Johannes SchindelinAug 17, 2021
  12. Miriam R.Aug 17, 2021
  13. 5/6 bisect--helper: reimplement `bisect_run` shell function in CMiriam Rubio, Aug 17, 2021
  14. Johannes SchindelinAug 17, 2021
  15. Miriam R.Aug 17, 2021
  16. Johannes SchindelinAug 17, 2021
  17. Christian CouderAug 18, 2021
  18. Miriam R.Aug 18, 2021
  19. 6/6 bisect--helper: retire `--bisect-next-check` subcommandMiriam Rubio, Aug 17, 2021
  20. Johannes SchindelinAug 17, 2021

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.