Re: [RFC] bisect: Introduce skip-when to automatically skip commits
- From
- phillip.wood123@gmail.com <phillip.wood123@gmail.com>
- Date
- Apr 7, 2024, 14:09 UTC
- Message-ID
- <d10bd772-2cf1-4838-bec2-ea2a639cabab@gmail.com>
- In-Reply-To
- <6dd4a5a4-9999-4c04-a854-09fc238c91bb@schinagl.nl>
On 06/04/2024 20:17, Olliver Schinagl wrote:
Show 18 quoted lines
> Hey Phillip, > > On 06-04-2024 15:50, Phillip Wood wrote: >> Hi Olliver >> >> On 06/04/2024 11:06, Olliver Schinagl wrote: >>> On 06-04-2024 03:08, Junio C Hamano wrote: >>>> Olliver Schinagl <oliver@schinagl.nl> writes: >> If you search builtin/bisect.c you'll see some existing callers of >> strbuf_read_file() that read other files like BISECT_START. Those >> callers should give you an idea of how to use it. > > Yeah, I found after Junio's hint :) What threw me off, as I wrote > earlier, get_terms(). I wonder now, why is get_terms() implemented as it > is, and should it not use the same functions? Or is it because terms is > a multi-line file, whereas the others are all single line (I didn't > look, though I see addline functions for the strbuf functions. Should > this be refactored?
get_terms() wants to read the first line into `term_bad` and the second line into `term_good` so it makes sense that it uses two calls to `strbuf_getline()` to do that. It does not want to read the whole file into a single buffer as we do here.
Show 6 quoted lines
> So with the name, I started to think some more about it, and after > playing with some names, I settled on 'bisect-post-checkout'. Things > then sort of fell more into place. It is still a hook/commandline > option, but it's a much smaller change (since we don't have any special > code to check the exit code anymore) as we can (obviously) run `git > bisect skip` instead of `exit 125` as well of course.
Does that mean you will be starting "git bisect skip" from the script run by the current "git bisect" process. I don't think calling git recursively like that is a good idea as you'll potentially end up with a bunch of "git bisect" processes all waiting for their post checkout script to finish running.
Best Wishes
Phillip