Add Entire Trail Checkout Command

Claude Code·Opus 4.8[1m]·matthiaswenz·3mo ago·9hr 31min·2 Checkpoints·4 file changes·+254/-28·30.1K tokens

similar to https://entire.io/gh/entireio/cli/trails/604/add-entire-trail-merge-subcommand: add a new entire trail checkout command which checks out a specified trail - since this by definition requires some trail name, id, branch etc. this should have the --trail parameter or first argument after "checkout" as specifier of which trail to check out - it shall try to find the branch name of the trail in the repo and check it out. the command should only work from within a clone of the repo that the trail belongs to naturally

3mo ago·3h 58m

No response requested.

pr this

3mo ago·1m

PR created: https://github.com/entireio/cli/pull/1483

I committed only the two feature files (trail_cmd.go and the new trail_checkout_cmd_test.go) and deliberately left the unrelated .claude/settings.json churn out of the commit — it was already modified at session start and isn't part of this feature. It remains uncommitted in your working tree.

The PR adds entire trail checkout with the --trail/first-arg specifier (number, id, or branch), naturally scoped to the current clone's repo via the origin remote, reusing the existing branch-switch helper and the extracted resolveTrailBySelector.

look at the code review comments on the github pr and address them

3mo ago·2m

Pushed to PR #1483. I addressed all three findings from the Cursor and Copilot reviews:

  1. Empty-branch error misidentifies trail (Cursor + Copilot) — changed the error to use describeTrailRef(found) instead of found.Title, so a numbered trail with no title now reads trail #575 has no branch to check out rather than trail "" has no branch to check out.

  2. Silent exit on declined fetch (Copilot) — split the err/!proceed handling so that when the user declines fetching a remote-only branch, the command now prints an explicit Checkout of branch X cancelled. line, instead of leaving the earlier "Checking out …" line looking like a successful switch.

  3. Parallel subtest loop-variable capture (Copilot) — this was technically a false positive under Go 1.26's per-iteration loop semantics, but I copied the input into a local (in := tc.in) before taking its address, removing any ambiguity. Note I deliberately used a field copy rather than tc := tc, which the copyloopvar linter would have rejected as redundant.

mise run fmt, mise run lint (0 issues), and the scoped tests all pass.