You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarify that backports should start from the squashed-and-merged commit #238
After pointing a new contributor to https://docs.python.org/devguide/gitbootcamp.html#backporting-merged-changes to handle their own backport PRs, I discovered that it's currently taking a step for granted: finding the relevant commit to backport from the CPython master branch, rather than squashing your original PR branch locally.
Since we specifically want to use the squashed-and-merged commit so that the backports include the corresponding commit message, we should make that explicit here.
I presume 'bpo-1235' is a stand-in for the fork branch the PR is based on. Once the merge is done, it disappears from the PR (as the PR can no longer be added to using the branch name ;-). Copying the commit hash available after the PR is merged seems best. I try to remember to grab it before I start typing the cherry_picker command. (Which is working quite well for simple backports.)
@terryjreedygit rev-parse ":/bpo-12345" searches for a commit message containing the given string (rather than a branch name) and returns the commit hash(es). But getting the commit hash from the PR page also works just as well.
(That said, "How do I find all commits mentioning a particular issue?" could be a useful cheatsheet entry in its own right)
I think indicating explicitly in that section which commit should be used would be helpful. The snippet you posted just now is what got me to the root of the problem/fix quickly. I think both the snippet referred to by Mariatta and your snippet could be useful on that page/section.
Activity
ncoghlan commentedon Jul 21, 2017
Some initial thoughts on how we might improve this:
Move https://docs.python.org/devguide/gitbootcamp.html#backporting-merged-changes to be directly after https://docs.python.org/devguide/gitbootcamp.html#accepting-and-merging-a-pull-request
Add a note suggesting the following pair of commands:
Mention that the relevant commit hash can also be found by looking at the merge notification on the original PR (e.g. bpo-30964: Mention ensurepip in package installation docs cpython#2786 (comment) )
Mariatta commentedon Jul 21, 2017
There's a write up about which commit hash to use in cherry_picker
It can be copied over here.
terryjreedy commentedon Jul 21, 2017
I presume 'bpo-1235' is a stand-in for the fork branch the PR is based on. Once the merge is done, it disappears from the PR (as the PR can no longer be added to using the branch name ;-). Copying the commit hash available after the PR is merged seems best. I try to remember to grab it before I start typing the cherry_picker command. (Which is working quite well for simple backports.)
ncoghlan commentedon Jul 21, 2017
@terryjreedy
git rev-parse ":/bpo-12345"searches for a commit message containing the given string (rather than a branch name) and returns the commit hash(es). But getting the commit hash from the PR page also works just as well.(That said, "How do I find all commits mentioning a particular issue?" could be a useful cheatsheet entry in its own right)
NicholasKobald commentedon Jul 21, 2017
I think indicating explicitly in that section which commit should be used would be helpful. The snippet you posted just now is what got me to the root of the problem/fix quickly. I think both the snippet referred to by Mariatta and your snippet could be useful on that page/section.
Clarify which commit hash is used for backporting
Clarify which commit hash is used for backporting (GH-254)
Clarify which commit hash is used for backporting (pythonGH-254)
Clarify which commit hash is used for backporting (GH-254)