feat: add --attach flag to workspace create for existing branches#15
Merged
feat: add --attach flag to workspace create for existing branches#15
Conversation
684a8f5 to
76c6c48
Compare
Allow creating a workspace that attaches to an existing branch without creating a new branch. The workspace name matches the branch name. Usage: as workspace create feature/auth --attach Key changes: - Add branch_exists() and worktree_add_existing() to git infrastructure - Add sanitize_branch_name() to handle branches with slashes (feature/auth -> feature-auth) - Add attach_worktree() for creating worktrees from existing branches - Add attach_branch parameter to WorkspaceService.create() - Add --attach/-a CLI flag to workspace create command Closes the feature request for workspace and branch handling.
b32ffed to
3748f9d
Compare
- Replace contextlib.suppress(Exception) with explicit try/except and logging in service.py cleanup path - Add logging for branch_delete() failures in git.py - Add test for "branch already checked out" error scenario - Add CLI integration tests for --attach flag using typer's CliRunner
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
--attach/-aflag toworkspace createcommandUsage
Changes
src/agentspaces/infrastructure/git.pybranch_exists()andworktree_add_existing()src/agentspaces/modules/workspace/worktree.pysanitize_branch_name()andattach_worktree()src/agentspaces/modules/workspace/service.pyattach_branchparameter tocreate()src/agentspaces/cli/workspace.py--attach/-aCLI flagTest plan
as workspace create <existing-branch> --attachas workspace create feature/auth --attach(branch with slash)