Skip to content

integration: short-circuit gs branch checkout for the integration#1256

Open
ed-irl wants to merge 2 commits into
ed-irl/integration-log-displayfrom
ed-irl/integration-checkout-shortcut
Open

integration: short-circuit gs branch checkout for the integration#1256
ed-irl wants to merge 2 commits into
ed-irl/integration-log-displayfrom
ed-irl/integration-checkout-shortcut

Conversation

@ed-irl

@ed-irl ed-irl commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

'gs bco ' previously fell into the generic "branch not
tracked" path: in interactive mode the user was prompted to track the
branch (and accepting would then fail with "cannot track integration
branch"), and in non-interactive mode they got a misleading warning
to run 'gs branch track'. Both are noise — the integration is
deliberately untracked and the user typed its name because they want
to switch to it.

Detect the integration branch in the branchCheckoutCmd up front. If
the requested name matches, emit a single targeted warning that the
branch is throwaway and short-circuit ShouldTrack to return false so
the existing CheckoutBranch path falls through to the plain checkout
without prompting.

This makes 'gs bco ' a viable alias for 'gs intco'
without introducing a separate command path or changing the checkout
handler's contract.

@ed-irl

ed-irl commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

@ed-irl ed-irl force-pushed the ed-irl/integration-log-display branch from 28adf10 to 41432f4 Compare June 13, 2026 13:40
@ed-irl ed-irl force-pushed the ed-irl/integration-checkout-shortcut branch from 7dbd7a4 to a28072b Compare June 13, 2026 13:40
@ed-irl ed-irl force-pushed the ed-irl/integration-log-display branch from 41432f4 to 2b66da9 Compare June 15, 2026 09:54
@ed-irl ed-irl force-pushed the ed-irl/integration-checkout-shortcut branch from a28072b to 781c846 Compare June 15, 2026 09:54
'gs bco <integration>' previously fell into the generic "branch not
tracked" path: in interactive mode the user was prompted to track the
branch (and accepting would then fail with "cannot track integration
branch"), and in non-interactive mode they got a misleading warning
to run 'gs branch track'. Both are noise — the integration is
deliberately untracked and the user typed its name because they want
to switch to it.

Detect the integration branch in the branchCheckoutCmd up front. If
the requested name matches, emit a single targeted warning that the
branch is throwaway and short-circuit ShouldTrack to return false so
the existing CheckoutBranch path falls through to the plain checkout
without prompting.

This makes 'gs bco <integration>' a viable alias for 'gs intco'
without introducing a separate command path or changing the checkout
handler's contract.
@ed-irl ed-irl force-pushed the ed-irl/integration-log-display branch from 241a02f to 157630c Compare June 24, 2026 01:33
@ed-irl ed-irl force-pushed the ed-irl/integration-checkout-shortcut branch from 81ff834 to 6237432 Compare June 24, 2026 01:33
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