-
v0.5.0
Stablereleased this
2026-11-12 06:33:28 +00:00 | 66 commits to main since this releaseAdded
- The
worktree setupcommand,gc roles worktree setup [--checkout <dir>] <work dir> [<default branch>], which makes the Worker's directory a linked worktree of its repository, detached atorigin/<default branch>, and leaves a directory that is one already as it is. The repository is--checkout, else the rig's (GC_RIG_ROOT), else the city's (GC_CITY_PATH). It does whatassets/scripts/worktree-setup.shdoes for the Worker'spre_start, which now calls the same script.
Fixed
- A Worker on a box that runs no
pre_start, as gc's ACP runtime runs none, no longer halts its bead in Part 2 ofmol-worker-work. gc creates the Worker'swork_dirfor every transport, as an empty plain directory that it stages files into, and starts the session there, so the directory was no linked worktree and under the city's checkout, wheregc roles worktree branchrefuses it andgitreads the city's repository, whichever rig the Worker works for. Part 2 now runsgc roles worktree setup "$GC_DIR" <base_branch>before anygitcommand, and halts the bead, without touching the checkout, when it fails. The Worker'spre_startkeeps its own call for the boxes that run it, and the command does nothing for a directory that is a worktree already. Part 2 passes it${GC_DIR:-$(pwd)}, the directory gc made for the Worker, and the current directory only whereGC_DIRis unset; the current directory alone, from a subdirectory of the worktree, made a worktree nested there, and the command also refuses a directory inside a linked worktree. - A Worker that halts no longer runs
git switch --detachoutside a linked worktree: a Worker halting before Part 2 had made its directory one detached the city's own checkout. The Halting section tells the two apart by comparinggit rev-parse --git-dirand--git-common-dirwith--path-format=absolute; without it, in a plain directory under a checkout git prints the first as an absolute path and the second as a relative one, the strings differ, and the check took the directory for a linked worktree. worktree-setup.shfills the work directory it finds, empty or holding staged files, in place instead of moving it aside and creating it again, so a session already running in the directory keeps its working directory. It arms the restore of the files it moves aside before it empties the directory, so a delete that fails half way leaves them in place, and it refuses a directory whose.gitis a dangling symlink, which the copy-back would have put over the new worktree's.git: no worktree, andgitthere reading the city's repository.
Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download
- The