This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Change "make patchcheck" to be branch aware
Type: enhancement Stage: resolved
Components: Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ncoghlan Nosy List: brett.cannon, ncoghlan
Priority: normal Keywords:

Created on 2017-02-26 04:52 by ncoghlan, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 302 merged ncoghlan, 2017-02-26 05:54
PR 626 merged ncoghlan, 2017-03-12 04:48
PR 627 merged ncoghlan, 2017-03-12 04:48
PR 628 merged ncoghlan, 2017-03-12 06:34
Messages (6)
msg288588 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-02-26 04:52
With the switch to a PR based workflow, I'm finding the current incarnation of "make patchcheck" less helpful than it used to be, as it only checks uncommitted changes, rather than all changes relative to the base branch.

Looking at Tools/scripts/patchcheck.py, it seems like it should be possible to use sys.version_info to calculate a suitable base branch ('master' if the release is alpha, '{major}.{minor}' otherwise), but things get a bit trickier from there:

- the local branches may not be up to date if the PR branch is based directly on a remote branch, so we can't rely on those
- figuring out which remote to use isn't immediately obvious, but we could probably go with an approach of using "upstream/{branch}" if an "upstream" remote is defined, and "origin/{branch}" otherwise
- once we have a base branch to use, then `git diff --name-status {branch}` should give us the file list in a similar format to the current `git status --porcelain`

I'll put together a PR for this approach.
msg289482 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-03-12 06:16
http://bugs.python.org/issue29798 is a follow-up issue to make the patchcheck script compatible with `git worktree`.
msg290213 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-03-24 22:24
New changeset c8869af89e9b62fbfd066c01da1f502b0fd2ed3f by Nick Coghlan in branch '2.7':
[2.7] bpo-29656: Handle PR branches in 'make patchcheck' (#302) (#628)
https://github.com/python/cpython/commit/c8869af89e9b62fbfd066c01da1f502b0fd2ed3f
msg290220 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-03-24 22:25
New changeset be31a837304f81842b13dbabdaaa14bb9bbe64af by Nick Coghlan in branch '3.5':
bpo-29656: Handle PR branches in 'make patchcheck' (#302) (#627)
https://github.com/python/cpython/commit/be31a837304f81842b13dbabdaaa14bb9bbe64af
msg290221 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-03-24 22:26
New changeset 2f386254e2cf054cc7ee5103b54c1cf16d9fa979 by Nick Coghlan in branch '3.6':
bpo-29656: Handle PR branches in 'make patchcheck' (#302) (#626)
https://github.com/python/cpython/commit/2f386254e2cf054cc7ee5103b54c1cf16d9fa979
msg290224 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-03-24 22:26
New changeset 482f7a274fa52b7ba34ff308cd9acdcac9f41ba5 by Nick Coghlan in branch 'master':
bpo-29656: Handle PR branches in 'make patchcheck' (#302)
https://github.com/python/cpython/commit/482f7a274fa52b7ba34ff308cd9acdcac9f41ba5
History
Date User Action Args
2022-04-11 14:58:43adminsetgithub: 73842
2017-03-24 22:26:50ncoghlansetmessages: + msg290224
2017-03-24 22:26:12ncoghlansetmessages: + msg290221
2017-03-24 22:25:51ncoghlansetmessages: + msg290220
2017-03-24 22:24:47ncoghlansetmessages: + msg290213
2017-03-12 09:36:09ncoghlansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-03-12 06:34:42ncoghlansetpull_requests: + pull_request516
2017-03-12 06:16:45ncoghlansetversions: + Python 3.5
2017-03-12 06:16:27ncoghlansetmessages: + msg289482
2017-03-12 04:48:52ncoghlansetpull_requests: + pull_request515
2017-03-12 04:48:31ncoghlansetpull_requests: + pull_request514
2017-03-03 21:25:34terry.reedysetstage: patch review
versions: + Python 2.7, Python 3.6, Python 3.7
2017-02-26 05:54:50ncoghlansetpull_requests: + pull_request268
2017-02-26 04:52:29ncoghlansettitle: Change "make patchcheck" to be branch aware? -> Change "make patchcheck" to be branch aware
2017-02-26 04:52:17ncoghlancreate