feat: add copy-on-write workspace mode (v0.14.0)#3
Merged
Conversation
Introduces a second workspace strategy alongside git worktrees. In CoW mode, each workspace is a full independent git clone; on filesystems that support reflinks (APFS, Btrfs, XFS) new workspaces are created instantly and share disk blocks with the source. Key additions: - internal/workspace package: mode-agnostic Manager, FindProjectRoot, CreateWorkspace, RemoveWorkspace, ListWorkspaces - workspace_mode config field (cow | worktree, default: worktree) - arbor init --mode flag with interactive prompt when flag absent - arbor switch command for bidirectional worktree ↔ CoW conversion - All CLI commands updated to delegate through workspace.Manager - Filesystem CoW detection with graceful fallback warning - .gitignore entry for .arbor.local local state file Existing worktree-mode projects are fully backward-compatible; workspace_mode defaults to worktree when absent from arbor.yaml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a second workspace strategy alongside git worktrees. In copy-on-write (CoW) mode, each workspace is a full independent git clone. On filesystems that support reflinks (APFS on macOS, Btrfs/XFS on Linux), new workspaces are created instantly and share disk blocks with the source until files are modified.
What's new
internal/workspacepackage — mode-agnosticManagerwithFindProjectRoot,CreateWorkspace,RemoveWorkspace,ListWorkspaces,ListWorkspacesDetailedworkspace_modeconfig field —coworworktree(default:worktree, fully backward-compatible)arbor init --modeflag — choose workspace mode at init time; interactive prompt when flag is absentarbor switchcommand — bidirectional conversion between modes (arbor switch cow/arbor switch worktree)work,remove,list,prune,destroy,sync,pull-configwork identically in both modes.gitignoreentry for.arbor.local— local state file is now properly excludedTesting
All tests written first (TDD), then implemented. 79 new tests across
internal/workspace/andinternal/cli/packages. Full suite passes with-race.0 linter issues.