Skip to content

fix: clear five CLI UX/logistical papercuts from a feature audit#88

Merged
andyrewlee merged 1 commit into
mainfrom
fix/cli-ux-audit
Jun 21, 2026
Merged

fix: clear five CLI UX/logistical papercuts from a feature audit#88
andyrewlee merged 1 commit into
mainfrom
fix/cli-ux-audit

Conversation

@andyrewlee

Copy link
Copy Markdown
Owner

What

Audited every command against a per-feature user-story spreadsheet (FEATURE_STORIES.csv, 122 stories) by driving the real binary in hermetic repos, then fixed every logistical/UX defect found.

Fixes

Command Before After
worktree rm <branch> (branch only in main worktree) leaked fatal: … is a main working tree "X is checked out in the main worktree, not a separate one; nothing to remove"
worktree <current-branch> worktree already exists → <main repo path> (misleading) clear "checked out in the main worktree; switch it to another branch first"
create / rename (invalid name) git's multi-line fatal: … not a valid branch name + advice hints one-line "X is not a valid branch name" (validated via git.CheckBranchName)
onto/modify/restack/sync (clean rebase) leaked Rebasing (1/1)Successfully rebased… silent on success (--quiet); conflict output preserved
sync --remote <missing> silently "succeeded" as no-remote errors remote "X" does not exist (consistent with submit); missing default origin still syncs locally

How it was found

FEATURE_STORIES.csv tracks each feature's user story, expected behaviour, test result, fix, and re-test result.

Tests

Adds Go regression tests for each fix (cmd/regression_phase3_test.go, plus stack.LinkedOwnerOf/MainWorktree and git.CheckBranchName unit tests). make ci green — stdlib-only, lint 0 issues, race + e2e, coverage 86.5%.

Audited every command against a per-feature user-story spreadsheet
(FEATURE_STORIES.csv) by driving the real binary in hermetic repos.
Fixes the issues that surfaced:

- worktree rm/add: a branch that lives only in the main worktree no
  longer leaks git's raw "is a main working tree" fatal or claims a
  dedicated worktree "already exists". LinkedOwnerOf/MainWorktree ignore
  the main worktree for add/rm.
- create/rename: validate the branch name up front (git.CheckBranchName
  via check-ref-format) so an invalid name gives a one-line error
  instead of git's multi-line fatal + advice hints.
- onto/modify/restack/sync: pass --quiet to the interactive rebase so a
  clean rebase stops leaking git's "Rebasing.../Successfully rebased"
  noise (conflict output is preserved).
- sync --remote <missing>: error like submit does instead of silently
  reporting success as "skipped (no remote)"; a missing default origin
  still syncs locally.

Adds Go regression tests for each; make ci green (coverage 86.5%).
@andyrewlee andyrewlee merged commit f85e378 into main Jun 21, 2026
4 checks passed
@andyrewlee andyrewlee deleted the fix/cli-ux-audit branch June 21, 2026 21:28
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.

1 participant