8000 Document auto-merge (#1084) · python/devguide@3978ed3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3978ed3

Browse files
authored
Document auto-merge (#1084)
1 parent 80c93e6 commit 3978ed3

File tree

2 files changed

+51
-21
lines changed

2 files changed

+51
-21
lines changed

core-developers/committing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ Seeing active branches
191191
If you use ``git branch``, then you will see a :ref:`list of branches
192192
<branchstatus>`. The only branch that receives new features is
193193
``main``, the in-development branch. The other branches receive only
194-
bug fixes or security fixes.
194+
bug fixes or security fixes. In almost all cases the fixes should first
195+
originate on ``main`` and then be ported back to older branches.
195196

196197

197198
.. _branch-merge:

getting-started/git-boot-camp.rst

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -461,37 +461,66 @@ Accepting and Merging a Pull Request
461461
------------------------------------
462462

463463
Pull requests can be accepted and merged by a Python Core Developer.
464+
You can read more about what to look for before accepting a change
465+
:ref:`here <committing>`.
464466

465-
1. At the bottom of the pull request page, click the ``Squash and merge``
466-
button.
467+
All pull requests have required checks that need to pass before a change
468+
can be merged. After a change was accepted by at least one core
469+
developer review, you can schedule an automatic merge of the change by
470+
clicking the gray ``Enable auto-merge (squash)`` button. You will find
471+
it at the bottom of the pull request page. The auto-merge will only
472+
happen if all the required checks pass.
467473

468-
2. Replace the reference to GitHub pull request ``#NNNN`` with ``GH-NNNN``.
469-
If the title is too long, the pull request number can be added to the
470-
message body.
474+
If all required checks are already finished on a PR you're reviewing,
475+
in place of the gray ``Enable auto-merge`` button you will find a green
476+
``Squash and merge`` button.
471477

472-
3. Adjust and clean up the commit message.
478+
In either case, adjust and clean up the commit message.
473479

474-
Example of good commit message::
480+
Here's an example of a **good** commit message::
475481

476-
gh-12345: Improve the spam module (GH-777)
482+
gh-12345: Improve the spam module (GH-777)
477483

478-
* Add method A to the spam module
479-
* Update the documentation of the spam module
484+
* Add method A to the spam module
485+
* Update the documentation of the spam module
480486

481-
Example of bad commit message::
487+
Here's an example of a **bad** commit message::
482488

483-
gh-12345: Improve the spam module (#777)
489+
gh-12345: Improve the spam module (#777)
484490

485-
* Improve the spam module
486-
* merge from main
487-
* adjust code based on review comment
488-
* rebased
491+
* Improve the spam module
492+
* merge from main
493+
* adjust code based on review comment
494+
* rebased
489495

490-
.. note::
491-
`How to Write a Git Commit Message <https://cbea.ms/git-commit/>`_
492-
is a nice article describing how to write a good commit message.
496+
The bad example contains bullet points that are a direct effect of the
497+
PR life cycle, while being irrelevant to the final change.
493498

494-
4. Press the ``Confirm squash and merge`` button.
499+
.. note::
500+
`How to Write a Git Commit Message <https://cbea.ms/git-commit/>`_
501+
is a nice article describing how to write a good commit message.
502+
503+
Finally, press the ``Confirm squash and merge`` button.
504+
505+
Cancelling an Automatic Merge
506+
-----------------------------
507+
508+
If you notice a problem with a pull request that was accepted and where
509+
auto-merge was enabled, you can still cancel the workflow before GitHub
510+
automatically merges the change.
511+
512+
Press the gray "Disable auto-merge" button on the bottom of the
513+
pull request page to disable automatic merging entirely. This is the
514+
recommended approach.
515+
516+
To pause automatic merging, apply the "DO-NOT-MERGE" label to the PR or
517+
submit a review requesting changes. The latter will put an "awaiting
518+
changes" label on the PR, which pauses the auto-merge similarly to
519+
"DO-NOT-MERGE". After the author submits a fix, re-requests review, and
520+
receives a new accepting review, auto-merge will complete.
521+
522+
Note that pushing new changes after the auto-merge flow was enabled
523+
does **NOT** stop it.
495524

496525
Backporting Merged Changes
497526
--------------------------

0 commit comments

Comments
 (0)
0