git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Olliver Schinagl <oliver@schinagl.nl>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Allow git bisect to auto-skip
Date: Sat, 23 Mar 2024 02:59:59 +0100	[thread overview]
Message-ID: <CC68481D-E993-49F2-8941-8F5FA080B139@schinagl.nl> (raw)
In-Reply-To: <xmqqwmptzyny.fsf@gitster.g>

Hey Junio,

On March 22, 2024 11:31:29 p.m. GMT+01:00, Junio C Hamano <gitster@pobox.com> wrote:
>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
>

This is a nice way to wrap got bisect, but from a UX point of view, having native support from the got client would be much nicer. E.g. the user doesn't have to learn about special scripts. I'd argue, if we can do it the same way everywhere (I.e. shipping such a script as part of the got distro), why not handle it nativily.

The magic word could be a default with an override in the gitconfig.

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

I've read the notes solution from 13 years ago ;) and I do like the elegance. But I think there's two cases. One during the fact, when you know this will be an issue andere in deed ons after the fact.

I'll admit, I was oblivious by git notes, and will read up on it now. Always using a note for this feature does make sense, as its part of the repository.


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

In the end, is it (internally) even possible for got bisect to check this, and would a patch that handles this 'behind the scenes' be accepted, without the user having to install special tooling (scripts)?

Having said that, on a different note is 'git copy' feasable? E.g. git CP old new, where both files share the same history?

Olliver


  reply	other threads:[~2024-03-23  2:00 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
2024-03-23  1:59   ` Olliver Schinagl [this message]
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CC68481D-E993-49F2-8941-8F5FA080B139@schinagl.nl \
    --to=oliver@schinagl.nl \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).