Repository navigation
feat: Show base ref in wt create summary - #34
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances wt create’s Git-phase summary to make the creation mode and base ref visible immediately by adding a From: line, backed by a new DescribeHead() helper for “current HEAD label” resolution. It also includes the supporting (and now-documented) branch-selection contract changes around explicit --checkout vs positional new-branch behavior, plus updated tests and docs to match.
Changes:
- Add
From:as a fourth line in the deferred Git-phase summary (stderr) and resolve its value pre-dispatch (outside the reinstall window). - Introduce
internal/worktree.DescribeHead()(branch name or short SHA when detached;"HEAD"fallback) and add unit tests. - Solidify and document the new-branch-only positional vs
--checkoutexisting-branch split, updating integration/unit tests and user docs accordingly.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/internal/worktree/crud.go | Adds sentinel errors and splits create-vs-checkout worktree operations into explicit functions. |
| src/internal/worktree/context.go | Adds DescribeHead() helper for best-effort HEAD labeling. |
| src/internal/worktree/context_test.go | Adds unit tests for DescribeHead() on-branch and detached-HEAD behavior. |
| src/cmd/wt/create.go | Computes createdSummaryFrom pre-dispatch and prints From: in the Git-phase summary; routes new --checkout vs positional semantics. |
| src/cmd/wt/create_test.go | Updates existing-branch create call sites to use --checkout and adds assertions for From: plus new conflict/error-path tests. |
| src/cmd/wt/list_test.go | Updates tests to use --checkout when targeting existing branches. |
| src/cmd/wt/integration_test.go | Updates integration coverage to use --checkout for existing-branch worktree creation. |
| src/cmd/wt/edge_test.go | Updates edge-case test to use --checkout for existing branch with special chars. |
| src/cmd/wt/delete_test.go | Updates delete-flow setup to use --checkout for existing branches. |
| README.md | Updates CLI docs and behavior table to reflect new positional/--checkout semantics and removes old warn-and-ignore wording. |
| docs/specs/worktree-layout.md | Updates branch↔worktree relationship examples to reference --checkout for existing branches. |
| docs/specs/cli-surface.md | Documents --checkout, new-branch-only positional semantics, and updated exit-code cases. |
| docs/site/workflows.md | Updates workflow guide to match --checkout behavior and removes prior --base ignored warnings. |
| docs/memory/wt-cli/log.md | Records memory index updates for the related CLI behavior changes. |
| docs/memory/wt-cli/init-failure-contract.md | Updates sibling-memory references to include the new create-branch semantics. |
| docs/memory/wt-cli/index.md | Adds create-branch-semantics entry to the memory index. |
| docs/memory/wt-cli/create-output-phases.md | Extends the documented Git-phase summary contract to include From: and its resolution rules. |
| docs/memory/wt-cli/create-branch-semantics.md | Adds a new memory doc capturing the wt create branch-selection contract and its invariants. |
| fab/changes/260717-aeka-create-summary-base-ref/plan.md | Captures the plan/acceptance for the From: summary enhancement. |
| fab/changes/260717-aeka-create-summary-base-ref/intake.md | Captures intake rationale and requirements for the From: line change. |
| fab/changes/260717-aeka-create-summary-base-ref/.status.yaml | Tracks change status/metrics for the aeka change. |
| fab/changes/260717-aeka-create-summary-base-ref/.history.jsonl | Records the change execution history for aeka. |
| fab/changes/260717-2af2-explicit-base-checkout-flags/plan.md | Captures the plan/acceptance for splitting positional vs --checkout behavior. |
| fab/changes/260717-2af2-explicit-base-checkout-flags/intake.md | Captures intake rationale for explicit --checkout and new-branch-only positional semantics. |
| fab/changes/260717-2af2-explicit-base-checkout-flags/.status.yaml | Tracks change status/metrics for the 2af2 change. |
| fab/changes/260717-2af2-explicit-base-checkout-flags/.history.jsonl | Records the change execution history for 2af2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sahil87
force-pushed
the
260717-aeka-create-summary-base-ref
branch
from
July 17, 2026 13:38
03f2a68 to
6a87073
Compare
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.
Meta
aekaexcludes
fab/,docs/· generated by fab-kit v2.15.5Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Summary
wt create's Git-phase summary printedCreated worktree:/Path:/Branch:but never showed what ref the new branch was based on, so users couldn't tell from the output whether a new branch was cut (and from where) or an existing branch was checked out directly onto a shared ref. This adds a fourthFrom:line to the summary that makes the creation mode and base ref visible at creation time.Changes
From:internal/worktree