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

Re: [RFC] bisect: Introduce skip-when to automatically skip commits

From
Pphillip.wood123@gmail.com <phillip.wood123@gmail.com>
Date
Apr 7, 2024, 15:12 UTC
Message-ID
<c4ed3e05-ae9f-42dd-835e-a52e710e70fd@gmail.com>
In-Reply-To
<2542ebd6-11ce-496b-b10b-b55c3a211705@schinagl.nl>
On 07/04/2024 15:52, Olliver Schinagl wrote:
Show 29 quoted lines
> Hey Phillip,
> 
> On 07-04-2024 16:09, phillip.wood123@gmail.com wrote:
>> On 06/04/2024 20:17, Olliver Schinagl wrote:
>>> 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.
> 
> Right, but I why not use strbuf_getline()?

Because you want the whole file, not just one line as the script name could potentially contain a newline

Show 22 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.
> 
> Well the process is inherently recursive, though that's up to the user 
> depending on what they put in their script of course. I don't think git 
> is 'waiting' is it? In that, git bisect runs the command, the command 
> runs git bisect, git bisect stores the commit hash in the skip file and 
> 'exists', which goes then back to the bisect job, which then continues 
> as it normally would.
> 
> So technically, we're not doing anything bad in git, but a user might do 
> something bad.

If I understand correctly we're encouraging the user to run "git bisect skip" from the post checkout script. Doesn't that mean we'll end up with a set of processes that look like

	- git bisect start
	  - post checkout script
             - git bisect skip
               - post checkout script
                 - git bisect skip
                   ...

as the "git bisect start" is waiting for the post checkout script to finish running, but that script is waiting for "git bisect skip" to finish running and so on. Each of those processes takes up system resources, similar to how a recursive function can exhaust the available stack space by calling itself over and over again.

Best Wishes
Phillip
Previous: Olliver SchinaglNext: Olliver Schinagl
Message 9 of 20 in “[RFC] bisect: Introduce skip-when to automatically skip commits”
  1. Olliver SchinaglMar 30, 2024
  2. Olliver SchinaglApr 5, 2024
  3. Junio C HamanoApr 6, 2024
  4. Olliver SchinaglApr 6, 2024
  5. Phillip WoodApr 6, 2024
  6. Olliver SchinaglApr 6, 2024
  7. phillip.wood123@gmail.comApr 7, 2024
  8. Olliver SchinaglApr 7, 2024
  9. phillip.wood123@gmail.comApr 7, 2024
  10. Olliver SchinaglApr 7, 2024
  11. Junio C HamanoApr 8, 2024
  12. Olliver SchinaglApr 10, 2024
  13. Junio C HamanoApr 10, 2024
  14. Olliver SchinaglApr 10, 2024
  15. Junio C HamanoApr 10, 2024
  16. Olliver SchinaglApr 10, 2024
  17. Phillip WoodApr 12, 2024
  18. Junio C HamanoApr 6, 2024
  19. Olliver SchinaglApr 6, 2024
  20. Olliver SchinaglApr 6, 2024

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.