Skip to content

switch command#51

Open
skarim wants to merge 4 commits intoskarim/simple-api-wrapperfrom
skarim/switch-branch
Open

switch command#51
skarim wants to merge 4 commits intoskarim/simple-api-wrapperfrom
skarim/switch-branch

Conversation

@skarim
Copy link
Copy Markdown
Collaborator

@skarim skarim commented Apr 17, 2026

Add gh stack switch command

Adds a new switch navigation command that shows an interactive picker for switching to any branch in the current stack. Branches are displayed top-to-bottom with their position number:

Select a branch in the stack to switch to
  5. frontend
  4. api-endpoints
  3. auth-layer
  2. db-schema
  1. config-setup

Copilot AI review requested due to automatic review settings April 17, 2026 08:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new gh stack switch CLI command that interactively lets users pick and check out another branch within the current stack.

Changes:

  • Introduces gh stack switch command implementation and wires it into the root command.
  • Adds test-only selection injection (Config.SelectFn) to allow deterministic interactive-selection tests.
  • Updates CLI reference docs and README to document the new command.
Show a summary per file
File Description
internal/config/config.go Adds SelectFn hook to simulate interactive selection in tests.
cmd/switch.go Implements the switch command with an interactive picker and checkout behavior.
cmd/root.go Registers the new switch command under gh stack.
cmd/switch_test.go Adds unit/integration-style tests for selection behavior, ordering, and error cases.
docs/src/content/docs/reference/cli.md Documents gh stack switch usage and example output.
README.md Adds switch to the command list and examples.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/6 changed files
  • Comments generated: 3

Comment thread cmd/switch.go
Comment thread cmd/switch.go
Comment thread cmd/switch.go Outdated
@skarim skarim force-pushed the skarim/switch-branch branch from 4db03c4 to c348c63 Compare April 17, 2026 08:24
@skarim skarim force-pushed the skarim/simple-api-wrapper branch from 0b144cc to 32de12d Compare April 17, 2026 08:24
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.

2 participants