Skip to content

Commit 5458b05

Browse files
authored
Clarify which commit hash is used for backporting (GH-254)
- Clarify which commit hash is used for backporting - Move ``Backporting Merged Changes`` section to right after the ``Accepting and Merging a Pull Request`` - Mention the git fetch upstream & git rev-parse combo Closes #238
1 parent fc6b0ab commit 5458b05

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

gitbootcamp.rst

+28-12
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,6 @@ Solution::
206206
$ git push --force origin some-branch
207207

208208

209-
Backporting Merged Changes
210-
--------------------------
211-
212-
A pull request may need to be backported into one of the maintenance branches
213-
after it has been accepted and merged into ``master``. It is usually indicated
214-
by the label ``needs backport to X.Y`` on the pull request itself.
215-
216-
Use the utility script `cherry_picker.py <https://github.com/python/core-workflow/tree/master/cherry_picker>`_
217-
from the `core-workflow <https://github.com/python/core-workflow>`_
218-
repository to backport the commit.
219-
220-
221209
.. _git_from_mercurial:
222210

223211
Applying a Patch from Mercurial to Git
@@ -313,6 +301,34 @@ Pull requests can be accepted and merged by a Python Core Developer.
313301
3. Press the ``Confirm squash and merge`` button.
314302

315303

304+
Backporting Merged Changes
305+
--------------------------
306+
307+
A pull request may need to be backported into one of the maintenance branches
308+
after it has been accepted and merged into ``master``. It is usually indicated
309+
by the label ``needs backport to X.Y`` on the pull request itself.
310+
311+
Use the utility script `cherry_picker.py <https://github.com/python/core-workflow/tree/master/cherry_picker>`_
312+
from the `core-workflow <https://github.com/python/core-workflow>`_
313+
repository to backport the commit.
314+
315+
The commit hash for backporting is the squashed commit that was merged to
316+
the ``master`` branch. On the merged pull request, scroll to the bottom of the
317+
page. Find the event that says something like::
318+
319+
<coredeveloper> merged commit <commit_sha1> into python:master <sometime> ago.
320+
321+
By following the link to ``<commit_sha1>``, you will get the full commit hash.
322+
323+
Alternatively, the commit hash can also be obtained by the following git commands::
324+
325+
$ git fetch upstream
326+
$ git rev-parse ":/bpo-12345"
327+
328+
The above commands will print out the hash of the commit containing ``"bpo-12345"``
329+
as part of the commit message.
330+
331+
316332
Editing a Pull Request Prior to Merging
317333
---------------------------------------
318334

0 commit comments

Comments
 (0)