sm get
Fetch a colleague's stack locally and reproduce its parent edges so sm log mirrors the author's tree.
Synopsis
sm get <PR-number>Examples
Pull PR #142 and every branch below it:
bash
sm get 142After it returns, HEAD is on the top branch and sm log shows the full tree.
What it does
- Calls
gh pr view <num> --json baseRefName,headRefNameto find the PR's base and head branches. - Walks the
base_refchain down to trunk, callinggh pr checkouton each branch. - Records parent metadata (
branch.<n>.stac-man-parentand-parent-sha) for every branch. - Records the PR number on each branch (
branch.<n>.stac-man-pr). - Leaves HEAD on the top branch (the one PR
<num>was opened against). - Prints
sm logso you can confirm the shape.
When to use it
- Reviewing a stacked PR another contributor opened — pull the whole stack so you can read it bottom-up.
- Resuming work on a different machine —
smmetadata is intentionally not pushed;sm getis the recovery path. - Debugging "why is PR #X targeting Y?" — the local checkout makes the relationships obvious.
What it does NOT do
- Get does not run
sm restack. The branches are checked out exactly as they exist on origin. - Get does not adopt branches that aren't part of the PR base chain. If the author has unsubmitted children locally, only the submitted ones are pulled.
See also
sm submit— the inverse: push your local stack as PRs.sm log— confirm the shape aftersm get.- Recipes → Review someone's stack.
