feat: grove convert CLI subcommand#28
Merged
Merged
Conversation
Extract the main worktree's current branch into a separate worktree: switches the main worktree onto the configured base branch, then adds a new worktree for the previously-checked-out branch. Pre-create / post-create hooks run by default (--no-hooks to skip). The shell-init wrapper now auto-cds into the new worktree after a successful `grove convert`, mirroring the existing `grove cd` behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace scan_worktrees with targeted current_branch + git_status_details to avoid the per-worktree status sweep and the gh pr list network call — only the main worktree's branch and dirty flag are needed. Route the phase-1 git switch through git::run_git_text instead of a raw Command, matching the rest of the codebase. Drop the single-field ConvertPlan wrapper, drop a redundant base_ref pass-through (the planner already falls back to the configured default), and trim WHAT comments. Co-Authored-By: Claude Opus 4.7 (1M context) <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
grove convert [path]— extracts the main worktree's current branch into a separate worktree and switches the main worktree onto the configured base branchgrove shell-initso the wrapper auto-cds into the new worktree aftergrove convert(matching howgrove cdalready works)cd "$(grove convert)"works without flagsBehavior
--no-hooksto skip-b/--baseoverrides the base branch to switch the main worktree ontoTest plan
cargo test— 5 new unit tests forplan_convertcover detached HEAD / on-base / dirty / no-main / happy pathcargo clippy --all-targets -- -D warningsclean🤖 Generated with Claude Code