[New-bugs-announce] [issue29656] Change "make patchcheck" to be branch aware?

Nick Coghlan report at bugs.python.org
Sat Feb 25 23:52:17 EST 2017


New submission from Nick Coghlan:

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.

----------
assignee: ncoghlan
messages: 288588
nosy: brett.cannon, ncoghlan
priority: normal
severity: normal
status: open
title: Change "make patchcheck" to be branch aware?
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29656>
_______________________________________


More information about the New-bugs-announce mailing list