feat: add machine-readable worktree creation for agents - #192
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR adds ChangesPorcelain worktree creation
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: 🔵 Low · up to The documented agent workflow still shows a command form that conflicts with the required public interface, which could mislead users or automation; the PR is otherwise mergeable with explicit owner follow-up to correct the example. Sequence Diagram(s)sequenceDiagram
participant Agent
participant git_gtr_new
participant WorktreeCreation
participant Hooks
Agent->>git_gtr_new: run new --porcelain
git_gtr_new->>WorktreeCreation: create worktree noninteractively
WorktreeCreation->>Hooks: inspect and run post-create hooks
Hooks-->>WorktreeCreation: return hook status
WorktreeCreation-->>Agent: stable records on stdout
Hooks-->>Agent: progress and hook output on stderr
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/instructions/testing.instructions.md:
- Around line 26-28: Update the machine-readable creation command example to
invoke the documented git gtr interface instead of the repository-relative
./bin/gtr path, preserving all existing arguments and output behavior.
In `@README.md`:
- Around line 193-196: Update the --porcelain documentation to clarify that
path, branch, and hook_status records are emitted only when cmd_create completes
successfully; explicitly state that a failing post-create hook exits before
emitting any success records.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c41681fa-44d7-4bdf-b8a2-86a656bc6cac
📒 Files selected for processing (13)
.github/instructions/testing.instructions.mdCHANGELOG.mdREADME.mdcompletions/_git-gtrcompletions/git-gtr.fishcompletions/gtr.bashdocs/agent-usage.mdlib/commands/create.shlib/commands/help.shlib/hooks.shscripts/generate-completions.shtests/cmd_create_integration.batstests/hooks.bats
Summary
git gtr new --porcelainwith stablepath,branch, andhook_statusrecordsWhy
This addresses the integration need raised in #67 without adding a long-running protocol server to the Bash CLI. Shell-capable agents can call
git gtrdirectly and reliably parse the created worktree path.Validation
shellcheck bin/gtr bin/git-gtr lib/*.sh lib/commands/*.sh adapters/editor/*.sh adapters/ai/*.sh./scripts/generate-completions.sh --checkbats tests/hooks.bats— 36/36 passedbats tests/cmd_create_integration.bats— 18/18 passedbats tests/— 552/553 passed; the remainingcmd_clean --merged uses nested registered worktree pathfailure reproduces unchanged on exactorigin/maingit gtrdisposable-repository smoke test verified strict stdout records, noisy-hook stderr isolation, returned path, and cleanupSummary by CodeRabbit
New Features
--porcelainoutput forgit gtr new, providing stable machine-readable worktree, branch, and hook-status records.Documentation
Chores
Tests