Skip to content

switch command#51

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

switch command#51
skarim wants to merge 5 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 2 times, most recently from 32de12d to ced6b5e Compare April 17, 2026 12:30
@skarim skarim force-pushed the skarim/switch-branch branch 2 times, most recently from 5bbf9e0 to ccca492 Compare April 17, 2026 20:50
@skarim skarim force-pushed the skarim/simple-api-wrapper branch from ced6b5e to a2c7a18 Compare April 17, 2026 20:50
@skarim skarim force-pushed the skarim/switch-branch branch from ccca492 to f5055d4 Compare April 17, 2026 21:50
@skarim skarim force-pushed the skarim/simple-api-wrapper branch from a2c7a18 to 0386acd Compare April 17, 2026 21:50
@skarim skarim force-pushed the skarim/switch-branch branch from 1458516 to e86589d Compare April 18, 2026 00:14
@skarim skarim disabled auto-merge April 18, 2026 00:24
@skarim skarim disabled auto-merge April 18, 2026 02:14
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