Skip to content

Commit 29ff168

Browse files
authored
[llvm][docs] Extend docs on GitHub's "squash and merge" (#129497)
From what I’ve observed, some contributors are still unaware that in LLVM, the PR summary - not the commit messages - is used as the final commit message when merging. This is especially unclear to those without commit access, as only users with commit access can edit the commit message before merging. This PR clarifies that policy and consolidates all relevant information into `GitHub.rst`, ensuring it is no longer split between `GitHub.rst` and `Contributing.rst`. Note, a big part of this change is merely moving text between the docs.
1 parent e2911aa commit 29ff168

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

llvm/docs/Contributing.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,10 @@ review by 'ping'ing the GitHub PR with "Ping" in a comment. The common courtesy
129129
is once a week. Please remember that you are asking for valuable time from
130130
other professional developers.
131131

132-
After your PR is approved, ensure that:
133-
134-
* The PR title and description describe the final changes. These will be used
135-
as the title and message of the final squashed commit. The titles and
136-
messages of commits in the PR will **not** be used.
137-
* You have set a valid email address in your GitHub account, see :ref:`github-email-address`.
138-
139-
Now you can merge your PR. If you do not have the ability to merge the PR, ask your
140-
reviewers to merge it on your behalf. You must do this explicitly, as reviewers'
141-
default assumption is that you are able to merge your own PR.
132+
After your PR is approved, you can merge it. If you do not have the ability to
133+
merge the PR, ask your reviewers to merge it on your behalf. You must do this
134+
explicitly, as reviewers' default assumption is that you are able to merge your
135+
own PR.
142136

143137
For more information on LLVM's code-review process, please see
144138
:doc:`CodeReview`.
@@ -148,6 +142,10 @@ For more information on LLVM's code-review process, please see
148142
For developers to commit changes from Git
149143
-----------------------------------------
150144

145+
.. note::
146+
See also :ref:`GitHub <github-reviews>` for more details on merging your changes
147+
into LLVM project monorepo.
148+
151149
Once a patch is reviewed, you can select the "Squash and merge" button in the
152150
GitHub web interface.
153151

llvm/docs/GitHub.rst

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ The LLVM Project uses `GitHub <https://github.com/>`_ for
1515
This page describes how the LLVM Project users and developers can
1616
participate in the project using GitHub.
1717

18+
Before your first PR
19+
====================
20+
21+
Please ensure that you have set a valid email address in your GitHub account,
22+
see :ref:`github-email-address`.
23+
1824
Branches
1925
========
2026

@@ -144,15 +150,31 @@ Approvals
144150
Before merging a PR you must have the required approvals. See
145151
:ref:`lgtm_how_a_patch_is_accepted` for more details.
146152

153+
147154
Landing your change
148155
-------------------
149156

150-
When your PR has been approved you can merge your changes.
157+
After your PR is approved, ensure that:
158+
159+
* The PR title and description describe the final changes. These will be used
160+
as the title and message of the final squashed commit. The titles and
161+
messages of commits in the PR will **not** be used.
162+
* You have set a valid email address in your GitHub account, see :ref:`github-email-address`.
151163

152-
If you do not have write permissions for the repository, the merge button in
153-
GitHub's web interface will be disabled. If this is the case, continue following
154-
the steps here but ask one of your reviewers to click the merge button on your
155-
behalf.
164+
.. note::
165+
The LLVM Project monorepo on GitHub is configured to always use "Squash
166+
and Merge" as the pull request merge option when using the web interface.
167+
With this option, GitHub uses the PR summary as the default commit
168+
message.
169+
170+
Users with write access who can merge PRs have a final opportunity to edit
171+
the commit title and message before merging. However, this option is not
172+
available to contributors without write access.
173+
174+
At this point, you can merge your changes. If you do not have write permissions
175+
for the repository, the merge button in GitHub's web interface will be
176+
disabled. If this is the case, continue following the steps here but ask one of
177+
your reviewers to click the merge button on your behalf.
156178

157179
If the PR is a single commit, all you need to do is click the merge button in
158180
GitHub's web interface.
@@ -214,7 +236,6 @@ commonly used first:
214236
request will understand that you're rebasing just your patches, and display
215237
this result correctly with a note that a force push did occur.
216238

217-
218239
Pre-merge Continuous Integration (CI)
219240
-------------------------------------
220241

0 commit comments

Comments
 (0)