Skip to content

Commit ba20d05

Browse files
committed
fixup! [docs][GitHub] Document alternative approach to stacked PRs
Expand + add a note on SPR
1 parent be8759d commit ba20d05

File tree

1 file changed

+36
-9
lines changed

1 file changed

+36
-9
lines changed

llvm/docs/GitHub.rst

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Before your first PR
2121
Please ensure that you have set a valid email address in your GitHub account,
2222
see :ref:`github-email-address`.
2323

24+
.. _github_branches:
25+
2426
Branches
2527
========
2628

@@ -32,17 +34,42 @@ aren't associated with a pull-request **will be deleted**.
3234
Stacked Pull Requests
3335
=====================
3436

35-
GitHub does not natively support stacked pull requests. There are two common
36-
alternatives:
37+
GitHub does not natively support stacked pull requests. However, there are
38+
several common alternatives.
39+
40+
To illustrate, let's assume you're working on two branches in your fork of the
41+
``llvm/llvm-project`` repository, and you want to eventually merge both into ``main``:
42+
43+
* `feature_1`, which contains commit `feature_commit_1`,
44+
* `feature_2`, which contains commit `feature_commit_2` and depends on
45+
`feature_1` (so it also includes `feature_commit_1`).
46+
47+
Your options are as follows:
48+
49+
#. Two PRs with dependency note
50+
51+
Create PR_1 for branch feature_1 and PR_2 for branch feature_2. In PR_2, add a
52+
note in the PR summary indicating that it is part of a series or depends on
53+
another PR (e.g., “Depends on #PR_1”). It's also helpful to highlight which
54+
commits belong to the base PR, so reviewers can focus on the new changes.
55+
56+
#. User branches in `llvm/llvm-project`
57+
58+
Create user branches in the main repository, as described
59+
:ref:`above<github_branches>`. Then:
60+
61+
* Create a pull request from `users/<username>/feature_1` → `main`
62+
* Create another from `users/<username>/feature_2` →
63+
`users/<username>/feature_1` Once `feature_1` is merged, you can update the
64+
base of the second PR to target main.
65+
66+
#. Use a stacked PR tool
3767

38-
* Add a note in your PR summary indicating that your patch is part of a
39-
series or depends on another PR (e.g., “Depends on #123456”). It also helps
40-
to highlight which commits belong to other PRs, so reviewers can focus only
41-
on the relevant changes.
42-
* Use Graphite (described below), a tool that supports stacked PR workflows.
68+
Use a tool like SPR or Graphite (described below) to manage stacked PRs more
69+
easily.
4370

44-
Both approaches help streamline the review process. Choose the one that works
45-
best for you.
71+
Each of these approaches can help streamline the review process. Choose the one
72+
that works best for your workflow.
4673

4774
Using Graphite for stacked Pull Requests
4875
----------------------------------------

0 commit comments

Comments
 (0)