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: make patchcheck doesn't detect changes if commit is done first
Type: enhancement Stage: resolved
Components: Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: cheryl.sabella, r.david.murray, rbcollins, terry.reedy
Priority: normal Keywords:

Created on 2015-07-28 04:00 by rbcollins, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg247501 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2015-07-28 04:00
./python ./Tools/scripts/patchcheck.py
Getting the list of files that have been added/changed ... 0 files
Fixing whitespace ... 0 files
Fixing C file whitespace ... 0 files
Fixing docs whitespace ... 0 files
Docs modified ... NO
Misc/ACKS updated ... NO
Misc/NEWS updated ... NO
configure regenerated ... not needed
pyconfig.h.in regenerated ... not needed
robertc@lifeless-z140:~/work/cpython.hg$ hg diff
robertc@lifeless-z140:~/work/cpython.hg$ hg push ssh://hg@hg.python.org/cpython
pushing to ssh://hg@hg.python.org/cpython
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 3 changes to 3 files
remote:  - file Lib/distutils/tests/test_core.py is not whitespace-normalized in ef5a2ba9df62
remote: * Run Tools/scripts/reindent.py on .py files or Tools/scripts/reindent-rst.py on .rst files listed above
remote: * and commit that change before pushing to this repo.
remote: transaction abort!
remote: rollback completed
remote: abort: pretxnchangegroup.checkwhitespace hook failed

The mistake I made was committing then running patchcheck.

I think it would make sense, if there are no changed files, to either 
a) error - it doesn't make sense to run like this, or
b) use the list of files from the most recent commit as the files to check.

I think b) would be easier on developers.
msg247783 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-07-31 22:43
Better: a local commit hook that rejects commits that cannot be pushed.  I think this has been discussed, but never done, unless something has been added to the devguide that I missed.

Better still: the hoped-for new workflow where patches are submitted to an automaton that checks, tests, commits, and merges for us.  I believe that this is part of both proposals that Brett Cannon will review.
msg247934 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-08-03 16:28
You can install the same (patchcheck-equivalent) hooks the repo uses in your local repo.  If this is not documented in the devguide it should be.  The hooks are publicly available (hg.python.org/hooks).  (It has been so long since I set this up for myself that I don't remember the steps precisely, but I'm sure I could figure it out by looking at my setup if someone needs the info.)
msg336787 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-02-28 00:50
I believe this issue has been resolved under the new Github workflow.  I ran `make patchcheck` on a commit that had been pushed and it identified the changes.
msg336796 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-02-28 03:32
I am pretty sure I have done the same after making all commits to the local branch.  Plus we have the better workflow.  So closing until there is a confirmed problem with the new workflow.
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68928
2019-02-28 03:32:16terry.reedysetstatus: open -> closed
resolution: out of date
messages: + msg336796

stage: needs patch -> resolved
2019-02-28 00:50:08cheryl.sabellasetnosy: + cheryl.sabella
messages: + msg336787
2015-08-03 16:28:01r.david.murraysetnosy: + r.david.murray
messages: + msg247934
2015-07-31 22:43:22terry.reedysetnosy: + terry.reedy
messages: + msg247783
2015-07-28 04:00:26rbcollinscreate