Repository navigation
Workspaces: park a workspace's clones when the clone switches workspace - #30
Merged
Merged
Conversation
One Delphi clone can now switch freely between ws/* branches and main. setup.sh installs .delphi/park.sh as the post-checkout hook: when a checkout changes the workspace (the new `name:` in workspace.yml), it renames the old workspace's repos/, worktrees/ and references/ into the git dir at delphi/<name>/ and renames the new one's back, so other workspaces never see them and every path is unchanged when they return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Switching a Delphi clone between
ws/*branches andmainleft the git-ignoredrepos/,worktrees/andreferences/in place, so every workspace (andmain) saw every other workspace's clones.What
park.sh, whichsetup.shinstalls as the clone'spost-checkouthook. When a checkout changes workspace, it renames the old workspace's clone folders into the git dir atdelphi/<name>/and renames the new one's back.mainhas no workspace, so it shows only its own files.workspace.ymlgainsname:(the folder name) so a checkout knows which workspace it is.check.shrequires it to match the folder and rejects it indefaults/;new-workspace.shsets it.Testing
tests/e2e.shadds coverage for parking, restoring, round trips, a folder in the way, and keeping a foreign hook (47 checks pass);ci/check.shpasses. Also exercised in a mock clone under macOS/bin/bash3.2, including linked Delphi worktrees.Existing clones pick it up by re-running setup once.