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

Re: Allow git bisect to auto-skip

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 22, 2024, 22:31 UTC
Message-ID
<xmqqwmptzyny.fsf@gitster.g>
In-Reply-To
<3d835c4b-d026-4c6a-b68e-6989a7a2065f@schinagl.nl>
Olliver Schinagl <oliver@schinagl.nl> writes:
Show 5 quoted lines
> In some cases, we know a commit will always break bisect. This is bad
> and evil but sometimes needed.
> ...
> git commit -m 'copy old to new' -m 'GIT_SKIP_BISECT'
> ...

If "I want a bisect to skip any commit that has 'Skip Me' in its subject" is the case, perhaps your "git bisect run" script can say

    #!/bin/sh
    case "$(git show -s --oneline)" in
    *"Skip Me"*) exit 125 ;;
    esac
    ... your test script body comes here ...
    if test successful
    then
        exit 0
    else
        exit 1
    fi

The _clue_ to mark a commit to be skipped does not have to be hardcoded commit title. It often is discovered that a commit breaks bisection after the fact and it is not feasible to rebase all the history after the commit. Maybe an approach more suitable in such a situation would attach a note to such untestable commits after the fact, and check if such a note is attached at the beginning of "git bisect run" script and exit with 125.

And a new "git bisect --skip-when <condition>" option can be added to manual bisection process. The <condition> part would contain something like

    case "$(git show -s --oneline)" in
    *"Skip Me"*) exit 125 ;;
    esac
taken from the above illustration.

But I am not sure what end result you are trying to achieve, so the above are random collection of ideas. Turning them into a patch is left as an exercise to readers.

Previous: Olliver SchinaglNext: Olliver Schinagl
Message 2 of 14 in “Allow git bisect to auto-skip”
  1. Olliver SchinaglMar 22, 2024
  2. Junio C HamanoMar 22, 2024
  3. Olliver SchinaglMar 23, 2024
  4. Stefan HallerMar 23, 2024
  5. Junio C HamanoMar 23, 2024
  6. Olliver SchinaglMar 23, 2024
  7. Olliver SchinaglMar 24, 2024
  8. Stefan HallerMar 24, 2024
  9. Christian CouderMar 24, 2024
  10. rsbecker@nexbridge.comMar 24, 2024
  11. Junio C HamanoMar 24, 2024
  12. Olliver SchinaglMar 27, 2024
  13. Junio C HamanoMar 27, 2024
  14. Olliver SchinaglMar 28, 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.