Re: [PATCH v4 5/6] bisect--helper: reimplement `bisect_run` shell function in C
From: Johannes Schindelin <hidden>
Date: 2021-08-17 21:37:00
Hi Miriam, On Tue, 17 Aug 2021, Miriam R. wrote:
El mar, 17 ago 2021 a las 13:42, Johannes Schindelin ([off-list ref]) escribió:quoted
On Tue, 17 Aug 2021, Miriam Rubio wrote:quoted
From: Tanushree Tumane <redacted> [...] + + 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.quoted
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/ (local)
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/ (local) 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