All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Olliver Schinagl <oliver@schinagl.nl>
Cc: git@vger.kernel.org
Subject: Re: Allow git bisect to auto-skip
Date: Fri, 22 Mar 2024 15:31:29 -0700	[thread overview]
Message-ID: <xmqqwmptzyny.fsf@gitster.g> (raw)
In-Reply-To: <3d835c4b-d026-4c6a-b68e-6989a7a2065f@schinagl.nl> (Olliver Schinagl's message of "Fri, 22 Mar 2024 23:18:47 +0100")

Olliver Schinagl <oliver@schinagl.nl> writes:

> 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.




  reply	other threads:[~2024-03-22 22:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 22:18 Allow git bisect to auto-skip Olliver Schinagl
2024-03-22 22:31 ` Junio C Hamano [this message]
2024-03-23  1:59   ` Olliver Schinagl
2024-03-23 13:51   ` Stefan Haller
2024-03-23 18:43     ` Junio C Hamano
2024-03-23 20:51       ` Olliver Schinagl
2024-03-24  7:47         ` Olliver Schinagl
2024-03-24 10:16       ` Stefan Haller
2024-03-24 14:29         ` Christian Couder
2024-03-24 16:04           ` rsbecker
2024-03-24 18:34           ` Junio C Hamano
2024-03-27 18:33             ` Olliver Schinagl
2024-03-27 19:24               ` Junio C Hamano
2024-03-28  8:01                 ` Olliver Schinagl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwmptzyny.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=oliver@schinagl.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.