Skip to content

Commit 0aa58d8

Browse files
cristianocclaude
andcommitted
Say how to create a stacked PR
The stacked-PR guidance did not say whether you hand `gh stack link` branches or PR numbers, so it read as though the PRs had to exist first. Either works, and branches alone are enough: the command pushes them and opens the PRs it does not find. Say what linking does to the bases too. It moves each one onto the branch below, which looks like a misconfigured PR if you are not expecting it, and CI keeps running throughout. Signed-off-by: Cristiano Calcagno <ccrisccris@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W8g8qwBARAcvW9MyuKQq8H
1 parent 9fad365 commit 0aa58d8

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,15 @@ The compiler is designed for fast feedback loops and scales to large codebases:
292292

293293
### Stacked pull requests
294294

295-
When a PR depends on another unmerged PR, create a native GitHub stack with
296-
`gh stack` rather than only targeting the preceding feature branch. Keep the
297-
branches linear and in the same repository, and list branches or PRs from
298-
bottom to top. For existing PRs, use `gh stack link BOTTOM_PR [NEXT_PR...]`,
299-
then verify that GitHub reports stack metadata and runs CI for every PR.
295+
When a PR depends on another unmerged PR, make a native GitHub stack. Keep the
296+
branches linear and in the same repository, then run `gh stack link BOTTOM
297+
[NEXT...]`, listing the stack bottom to top. Each argument is a branch name or
298+
a PR number: the command pushes each branch, reuses the PR that already exists
299+
for it, and opens one where there is none, so branches alone are enough. Open
300+
the PRs yourself first if you want to write their titles and descriptions.
301+
302+
Linking sets each PR's base to the branch below it, leaving only the bottom PR
303+
on `master`. CI runs on every PR in the stack.
300304

301305
### Code Quality
302306

0 commit comments

Comments
 (0)