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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 10, 2024, 16:47 UTC
Message-ID
<xmqqzfu1upty.fsf@gitster.g>
In-Reply-To
<116dd27e-2e30-4915-a131-6c71c999fccd@schinagl.nl>
Olliver Schinagl <oliver@schinagl.nl> writes:
> While completly orthonogal, I agree; it would be nice to have and
> 'abuse' for the bisect-skip usecase. So if we ignore the fact that it
> can be abused for this (which I don't think is a bad thing, it just
> risks the recursive issue Phillip mentioned.

I do not see the "recursive" issue here, though. If we had such a mechansim, those whose test cannot be driven by "bisect run" can still use the "--post-checkout" and "--pre-resume" options, where the post-checkout option names a file that has:

	#!/bin/sh
        if git merge-base --is-ancestor $the_other_bug HEAD
        then
          # we need the fix
          git cherry-pick --no-commit $fix_for_the_other_bug ||
          exit 125
        fi

in it. There is no "recursive"-ness here. And then after manually testing the checked out stuff (with tweak, thanks to the post-checkout script), they can now say "git bisect good/bad/skip" and that is when their --pre-resume script kicks in, which may do

	#!/bin/sh
	git reset --hard ;# undo the damage done by post-checkout
before the bisect machinery goes and picks the next commit to test.

Notice that I still kept the "exit 125" in the above post-checkout example? That is where the "bisect next" that picked the commit to test, checked out that commit and updated the working tree, and run your post-checkout script, can be told that the version checked out is untestable and to be skipped. So such a post-checkout script can be treated as a strict superset of --skip-when script we have been discussing.

Needless to say, if we were to do this, we probably should let "bisect run" also pay attention to these two scripts. They are most likely to become new parameters specified when "bisect start" is run to be recorded as one of the many states "git bisect" creates.

Previous: Olliver SchinaglNext: Olliver Schinagl
Message 13 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.