@@ -461,37 +461,66 @@ Accepting and Merging a Pull Request
461
461
------------------------------------
462
462
463
463
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 >`.
464
466
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.
467
473
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 .
471
477
472
- 3. Adjust and clean up the commit message.
478
+ In either case, adjust and clean up the commit message.
473
479
474
- Example of good commit message::
480
+ Here's an example of a ** good ** commit message::
475
481
476
- gh-12345: Improve the spam module (GH-777)
482
+ gh-12345: Improve the spam module (GH-777)
477
483
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
480
486
481
- Example of bad commit message::
487
+ Here's an example of a ** bad ** commit message::
482
488
483
- gh-12345: Improve the spam module (#777)
489
+ gh-12345: Improve the spam module (#777)
484
490
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
489
495
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.
493
498
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.
495
524
496
525
Backporting Merged Changes
497
526
--------------------------
0 commit comments