Make the workspace collector worktree-aware so in-flight agent work stays visible #117
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#117
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Once agent branch work moves into worktrees outside
~/work,work-diffstops showing it, so the cross-repo view of uncommitted work goes blind exactly when several agents are running. Teach the shared workspace collector about worktrees so in-flight agent work stays visible without putting non-registry directories into~/work.Part of allod/tools#115.
Primary goals:
work-diff— uncommitted changes in an agent's worktree appear under the repo they belong to, attributed to their branch, alongside the shared checkout's own status.pull-alloff worktrees — sync operates on registry checkouts only; a worktree is never treated as a repo to pull or switch.git worktree listper collected repo rather than globbing a directory, so the answer stays correct wherever worktrees are sited.~/workcontinues to contain exactly the checkouts the inventory registry declares.Current state
lib/workspace.shworkspace_collect_reposenumerates directories underWORK_DIRand returns anything that is a repo root;work-diff,pull-all,flake-status, andflake-update-cascadeall consume it. Two consequences follow, both verified: a worktree placed under~/workis collected as if it were an ordinary repo, sopull-allattemptsgit pullon a branch with no upstream and reports an error; and a worktree placed anywhere else is invisible towork-diff, which is the whole cross-repo status view.Note that
workspace_is_repo_rootalready accepts a linked worktree, since it tests[[ -e "$dir/.git" ]]and a worktree's.gitis a file rather than a directory. Any fix therefore needs to distinguish a registry checkout from a linked worktree deliberately rather than relying on that test.Suggested shape
Add a collector entry point that returns registry checkouts (today's behavior, used by
pull-all,flake-status, andflake-update-cascade) and a second that returns each checkout's linked worktrees, used bywork-diff.git -C <repo> worktree list --porcelaingives path, branch, and detached state in one call. Rendering worktrees indented under their repo keeps a repo's full state in one place in the output.Scope
In:
lib/workspace.sh,workspace/work-diff, and confirmation thatpull-alland the flake tools keep operating on registry checkouts only, plus tests. Out: where worktrees are created, which is allod/tools#116.