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

Re: Workflow for bisecting with test in a branch

From
Christian Couder <christian.couder@gmail.com>
Date
Apr 28, 2025, 07:41 UTC
Message-ID
<CAP8UFD1fzLjNdrhv8yuGJmjKsJRU0kaa4rtV=ur+3CMYZD2wzA@mail.gmail.com>
In-Reply-To
<02671927-2e65-4bd3-904b-b564849d1fa5@engmark.name>
On Sun, Apr 27, 2025 at 10:18 AM Victor Engmark <victor@engmark.name> wrote:
Show 5 quoted lines
>
> I'd like to bisect using a test I've written in a different branch from
> the one I'm bisecting. But to do `git bisect run ./test.bash` I have to
> keep the new test file and an old test suite file the same during the
> whole `bisect` process. This turned out pretty cumbersome:
[...]
> Is there a more streamlined way to achieve the same thing, that is,
> forcing some checked-in files to not change while bisecting?

You could perhaps use worktrees (see https://git-scm.com/docs/git-worktree) to have a separate worktree with the checked-in files that shouldn't change, while performing the bisection and building in the main worktree. If all the needed files and directories are properly set up on the separate worktree, you could copy them over using a single `cp -a ...` command.

Also I think that conceptually it's more the responsibility of your build and test system, rather than the SCM, to provide you with clean, out of source builds and tests.

Best, Christian.

Previous: Victor Engmark
Message 2 of 2 in “Workflow for bisecting with test in a branch”
  1. Victor EngmarkApr 27, 2025
  2. Christian CouderApr 28, 2025

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.