Skip to content

Reflink dependencies into new worktrees - #207

Closed
aglowinthefield wants to merge 1 commit into
nkzw-tech:mainfrom
aglowinthefield:wt-dep-clone
Closed

aglowinthefield wants to merge 1 commit into
nkzw-tech:mainfrom
aglowinthefield:wt-dep-clone

Conversation

@aglowinthefield

Copy link
Copy Markdown

Adds a Worktrunk pre-start hook. It reflinks the main checkout's dependencies and build caches (listed in .worktreeinclude) into each new worktree, then lets the package manager install only what the branch changed. On APFS the copy uses no extra disk.

To run it after git worktree add: wt -C <worktree> hook pre-start --foreground --yes. Tested by running the hook in this branch's own worktree: it exits 0 and leaves the lockfile unchanged.

A Worktrunk pre-start hook copies the main checkout's ignored files listed in
.worktreeinclude into each new worktree. On APFS the copy is a reflink, so it
uses no extra disk. The package manager then installs only what the branch's
lockfile changed, instead of a full install per worktree.

Run it after `git worktree add` with:
  wt -C <worktree> hook pre-start --foreground --yes
@aglowinthefield

Copy link
Copy Markdown
Author

Opened by mistake against upstream; sorry for the noise.

@aglowinthefield
aglowinthefield deleted the wt-dep-clone branch November 27, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant