git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Olliver Schinagl <oliver@schinagl.nl>
Cc: phillip.wood123@gmail.com,  phillip.wood@dunelm.org.uk,
	git@vger.kernel.org,
	 Christian Couder <christian.couder@gmail.com>,
	Stefan Haller <lists@haller-berlin.de>
Subject: Re: [RFC] bisect: Introduce skip-when to automatically skip commits
Date: Wed, 10 Apr 2024 09:47:53 -0700	[thread overview]
Message-ID: <xmqqzfu1upty.fsf@gitster.g> (raw)
In-Reply-To: <116dd27e-2e30-4915-a131-6c71c999fccd@schinagl.nl> (Olliver Schinagl's message of "Wed, 10 Apr 2024 12:39:03 +0200")

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.


  reply	other threads:[~2024-04-10 16:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-30  8:10 [RFC] bisect: Introduce skip-when to automatically skip commits Olliver Schinagl
2024-04-05  6:50 ` Olliver Schinagl
2024-04-06  1:08   ` Junio C Hamano
2024-04-06 10:06     ` Olliver Schinagl
2024-04-06 13:50       ` Phillip Wood
2024-04-06 19:17         ` Olliver Schinagl
2024-04-07 14:09           ` phillip.wood123
2024-04-07 14:52             ` Olliver Schinagl
2024-04-07 15:12               ` phillip.wood123
2024-04-07 21:11                 ` Olliver Schinagl
2024-04-08 16:49                 ` Junio C Hamano
2024-04-10 10:39                   ` Olliver Schinagl
2024-04-10 16:47                     ` Junio C Hamano [this message]
2024-04-10 19:22                       ` Olliver Schinagl
2024-04-10 19:31                         ` Junio C Hamano
2024-04-10 19:39                           ` Olliver Schinagl
2024-04-12 13:35                   ` Phillip Wood
2024-04-06 17:07       ` Junio C Hamano
2024-04-06 19:19         ` Olliver Schinagl
2024-04-06 10:22     ` 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=xmqqzfu1upty.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lists@haller-berlin.de \
    --cc=oliver@schinagl.nl \
    --cc=phillip.wood123@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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).