From 24e8622634f6f97633df756e4abfbb30c7d7e2d6 Mon Sep 17 00:00:00 2001 From: Mariatta Wijaya Date: Sun, 27 Aug 2017 21:09:05 -0700 Subject: [PATCH 1/2] Clarify which commit hash is used for backporting Move ``Backporting Merged Changes`` section to right after the ``Accepting and Merging a Pull Request`` Closes https://github.com/python/devguide/issues/238 --- gitbootcamp.rst | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/gitbootcamp.rst b/gitbootcamp.rst index 80daf1698..89a805f90 100644 --- a/gitbootcamp.rst +++ b/gitbootcamp.rst @@ -199,18 +199,6 @@ Solution:: $ git push --force origin some-branch -Backporting Merged Changes --------------------------- - -A pull request may need to be backported into one of the maintenance branches -after it has been accepted and merged into ``master``. It is usually indicated -by the label ``needs backport to X.Y`` on the pull request itself. - -Use the utility script `cherry_picker.py `_ -from the `core-workflow `_ -repository to backport the commit. - - .. _git_from_mercurial: Applying a Patch from Mercurial to Git @@ -305,6 +293,26 @@ Pull requests can be accepted and merged by a Python Core Developer. 3. Press the ``Confirm squash and merge`` button. +Backporting Merged Changes +-------------------------- + +A pull request may need to be backported into one of the maintenance branches +after it has been accepted and merged into ``master``. It is usually indicated +by the label ``needs backport to X.Y`` on the pull request itself. + +Use the utility script `cherry_picker.py `_ +from the `core-workflow `_ +repository to backport the commit. + +The commit hash for backporting is the squashed commit that was merged to +the ``master`` branch. On the merged pull request, scroll to the bottom of the +page. Find the event that says something like:: + + merged commit into python:master ago. + +By following the link to ````, you will get the full commit hash. + + Editing a Pull Request Prior to Merging --------------------------------------- From 56ed1211b265aec618ff51683159c8ce528cd446 Mon Sep 17 00:00:00 2001 From: Mariatta Wijaya Date: Sun, 27 Aug 2017 21:42:40 -0700 Subject: [PATCH 2/2] Mention the git fetch upstream & git rev-parse combo --- gitbootcamp.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gitbootcamp.rst b/gitbootcamp.rst index 89a805f90..0f26aac10 100644 --- a/gitbootcamp.rst +++ b/gitbootcamp.rst @@ -312,6 +312,14 @@ page. Find the event that says something like:: By following the link to ````, you will get the full commit hash. +Alternatively, the commit hash can also be obtained by the following git commands:: + + $ git fetch upstream + $ git rev-parse ":/bpo-12345" + +The above commands will print out the hash of the commit containing ``"bpo-12345"`` +as part of the commit message. + Editing a Pull Request Prior to Merging ---------------------------------------