Skip to content

feat: Show base ref in wt create summary - #34

Merged
sahil-noon merged 3 commits into
mainfrom
260717-aeka-create-summary-base-ref
Jul 17, 2026
Merged

sahil-noon merged 3 commits into
mainfrom
260717-aeka-create-summary-base-ref

Conversation

@sahil-noon

Copy link
Copy Markdown
Collaborator

Meta

Change ID Type Confidence Plan Review
aeka feat 4.4/5.0 6/6 tasks, 13/13 acceptance ✓ ✓ 1 cycle
Impact +/− Net
raw +1637 / −150 +1487
true +385 / −120 +265
└ impl +201 / −69 +132
└ tests +184 / −51 +133

excludes fab/, docs/ · generated by fab-kit v2.15.5

Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr

Summary

wt create's Git-phase summary printed Created 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 fourth From: line to the summary that makes the creation mode and base ref visible at creation time.

Changes

  • A fourth summary line: From:
  • HEAD resolution helper in internal/worktree
  • Resolution timing: before the create dispatch, outside the reinstall window
  • Out of scope / unchanged
  • Tests

@sahil-noon
sahil-noon marked this pull request as ready for review July 17, 2026 09:22
@sahil-noon
sahil-noon requested a review from Copilot July 17, 2026 09:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --checkout existing-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
sahil87 force-pushed the 260717-aeka-create-summary-base-ref branch from 03f2a68 to 6a87073 Compare July 17, 2026 13:38
@sahil-noon
sahil-noon merged commit dfb9660 into main Jul 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants