feat: add smart template generation and branch/ref management#3
Merged
feat: add smart template generation and branch/ref management#3
Conversation
Modify `wisp init -t <name>` to handle three cases: - If .wisp/ doesn't exist: create full structure with template - If .wisp/ exists but template doesn't: create only the template - If both exist: error unless --force is used to overwrite This allows users to add new templates to already-initialized projects without recreating the entire .wisp/ structure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests for: - Template-only creation when .wisp/ already exists - --force flag to overwrite existing templates - Template content correctness in template-only creation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…patibility - Add SiblingRepo struct with Repo and Ref fields - Implement UnmarshalYAML for backwards compatibility with string format - Update Session struct with Ref and Continue fields - Update all code and tests to use new SiblingRepo type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parses "org/repo" or "org/repo@ref" format, returning repo and ref parts. Uses LastIndex to handle refs containing @ signs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --continue flag for working on existing branches - Parse @ref syntax from --repo and --sibling-repos flags - Store Ref and Continue fields in session - Add validation: --continue requires --branch - Add validation: --continue and @ref are mutually exclusive 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ref parameter to CloneRepo for checking out specific refs - Add fetchAndCheckoutBranch for --continue mode - Add checkoutRef for branching from specific base refs - Update SetupSprite to handle ref and continue modes: - Continue mode: fetch and checkout existing branch - Ref mode: checkout base ref, then create branch from it - Default: create new branch from default branch - Update resume.go to pass sibling refs to CloneRepo 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive tests for: - Marshaling SiblingRepo with and without ref - Unmarshaling legacy string format - Unmarshaling new struct format with and without ref - Round-trip compatibility for SiblingRepo and Session 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests to verify the --continue flag is properly registered and all expected start command flags are available. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.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.
Summary
This PR adds two related enhancements to wisp's initialization and repository management. Users can now add new templates to already-initialized projects with
wisp init -t <name>, and can specify branches, tags, or commits when cloning repositories using the@refsyntax. These changes enable more flexible workflows like continuing work on existing branches and pinning sibling repos to specific versions.Key Changes
wisp init -t <name>now creates only the template when.wisp/already exists, with--forceflag to overwrite existing templates@refsyntax for primary repo (-r org/repo@v1.0.0) and siblings (--sibling org/repo@branch)--continueflag allows working directly on an existing remote branchTasks completed (13/13)
🤖 Generated with wisp