Skip to content

remote checkout#14

Merged
skarim merged 3 commits intomainfrom
skarim/remote-checkout
Apr 10, 2026
Merged

remote checkout#14
skarim merged 3 commits intomainfrom
skarim/remote-checkout

Conversation

@skarim
Copy link
Copy Markdown
Collaborator

@skarim skarim commented Apr 10, 2026

The gh stack checkout command now supports checking out stacks from GitHub using a PR number, pulling branches and setting up the stack locally. When a branch name is provided, the command only resolves locally tracked stacks.

Copilot AI review requested due to automatic review settings April 10, 2026 03:00
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 support for checking out a stacked PR set from GitHub when gh stack checkout is given a PR number, importing branches and creating local stack tracking; branch-name checkout remains local-only.

Changes:

  • Extend gh stack checkout to resolve numeric targets via GitHub stack APIs (list stacks, fetch PR details, import branches, reconcile with local stacks).
  • Add GitHub client interface support for listing stacks and fetching PRs by number (plus mock support) and update user-facing docs accordingly.
  • Improve Ctrl+C prompt cleanup for Select prompts and adjust messaging for “stacked PRs not enabled”.
Show a summary per file
File Description
skills/gh-stack/SKILL.md Updates skill docs to describe PR-number remote checkout and clarify branch-name is local-only.
README.md Updates command reference docs to describe remote checkout behavior and CLI syntax.
internal/github/mock_client.go Adds mock hooks for FindPRByNumber and ListStacks.
internal/github/github.go Adds FindPRByNumber, ListStacks, and refactors repositoryID placement.
internal/github/client_interface.go Extends ClientOps with FindPRByNumber and ListStacks.
docs/src/content/docs/reference/cli.md Updates published CLI docs to match new checkout behavior.
cmd/utils.go Adds clearSelectPrompt for cleaning up interrupted Select prompts.
cmd/submit.go Updates warning text for 404 “stacked PRs not enabled”.
cmd/submit_test.go Updates assertion to match new warning text.
cmd/rebase.go Removes Cobra Example text.
cmd/push.go Clears Select prompt on interrupt when choosing a remote.
cmd/init.go Removes Cobra Example text.
cmd/checkout.go Implements remote stack checkout by PR number, stack import, and conflict resolution flow.
cmd/checkout_test.go Adds extensive tests covering numeric target behavior and remote import flows.

Copilot's findings

Tip

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

Comments suppressed due to low confidence (1)

cmd/checkout.go:490

  • importRemoteStack ignores the error from git.RevParse(trunk) when computing trunkSHA. If RevParse fails, the stack is saved with an empty/incorrect trunk head, which can mislead later logic relying on trunk metadata. Handle the error and abort (or at least surface a clear error) rather than silently discarding it.
	trunkSHA, _ := git.RevParse(trunk)
	newStack := stack.Stack{
		ID: remoteStackID,
		Trunk: stack.BranchRef{
			Branch: trunk,
  • Files reviewed: 14/14 changed files
  • Comments generated: 4

Copy link
Copy Markdown

Copilot AI commented Apr 10, 2026

Warning

This is an internal experiment to assess Copilot's ability to auto-approve PRs. Please 👍 this comment if the assessment below is correct and 👎 if not. Feedback in #f-ccr-auto-approve is appreciated!

Copilot thinks this PR is not ready to approve — see review comments for details.

@skarim skarim merged commit 7fd5e09 into main Apr 10, 2026
6 checks passed
@skarim skarim deleted the skarim/remote-checkout branch April 10, 2026 05:15
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