Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

switch command#51

Merged
skarim merged 5 commits into
skarim/simple-api-wrappergithub/gh-stack:skarim/simple-api-wrapperfrom
skarim/switch-branchgithub/gh-stack:skarim/switch-branchCopy head branch name to clipboard
Apr 20, 2026
Merged

switch command#51
skarim merged 5 commits into
skarim/simple-api-wrappergithub/gh-stack:skarim/simple-api-wrapperfrom
skarim/switch-branchgithub/gh-stack:skarim/switch-branchCopy head branch name to clipboard

Conversation

@skarim

@skarim skarim commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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
@skarim skarim merged commit 6eda231 into main Apr 20, 2026
@skarim skarim deleted the skarim/switch-branch branch April 20, 2026 14:17
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
skarim added a commit that referenced this pull request Apr 20, 2026
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.