[issue16405] Explain how to set up the whitespace commit hook locally
Nick Coghlan added the comment: Oh, so *that's* why my local hook isn't aborting commits when the whitespace check fails :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Ned Deily added the comment: Thanks for the patch, Carol. (I made a few minor changes before committing: to the file paths and to make it clearer that one should choose one of the hooks.) -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Roundup Robot added the comment: New changeset b494a25915a9 by Ned Deily in branch 'default': Issue #16405: Explain how to set up the whitespace commit hook locally. https://hg.python.org/devguide/rev/b494a25915a9 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Ned Deily added the comment: The wording of the patch looks good to me other than one issue: which hook to use. I notice Nick's suggestion is to use the hg commit hook. But in the comments for the checkwhitespace hook itself, pretxncommit is the suggested hook. The difference between them, AFAIK, is that the commit hook is executed after the changeset has been created and applied in the local repo, while the pretxncommit hook is called before the changeset is committed and can thus abort the commit. So in either case, you'll see the warning message from the hook if the changeset has extraneous white space but when using the commit hook the changeset will be applied anyway and, to fix it, you either have to strip it or commit a fix in an additional changeset. There may be some workflows where using commit is a better choice (like when using mq) but I think in general using the pretxncommit hook is the better choice. Opinions? https://hg.python.org/hooks/file/default/checkwhitespace.py#l10 -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Carol Willing added the comment: Adds whitespace checking hook setup information to Minimal Configuration section of devguide [1]. Patch is ready for review. [1] https://docs.python.org/devguide/committing.html#minimal-configuration -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file38988/iss-hooks.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Carol Willing added the comment: Patch is ready for review. Ned's feedback on pretxncommit hook is added. -- Added file: http://bugs.python.org/file39031/iss-hooks-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Changes by Carol Willing willi...@willingconsulting.com: -- assignee: - willingc nosy: +willingc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Carol Willing added the comment: Ned, Thanks for the review and feedback. It seems reasonable to me to mention both the pretxncommit hook as well as the commit hook as well as your brief comments on the difference between the two. I'll make that change to the patch and resubmit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Changes by Ronald Oussoren ronaldousso...@mac.com: -- nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Terry J. Reedy added the comment: I would be helped by such an explanation in the devguide. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
New submission from Nick Coghlan: Setting up the same commit checks locally that the main repo enforces for incoming patch sets can save a great deal of frustration with the server rejecting hg push for changes (this can be especially frustrating if you have already merged changes across branches). The committer section of the devguide [1] should explain how to: 1. Check out the hooks repo from hg.python.org 2. Configure the whitespace checking hook by adding this to hgrc for the relevant repo(s) (adjusting the path appropriately for the checked out location of the hooks repo): [hooks] commit = python:~/devel/hg_hooks/checkwhitespace.py:check_whitespace_single [1] http://docs.python.org/devguide/committing.html#committing-and-pushing-changes -- components: Devguide messages: 174810 nosy: ezio.melotti, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Explain how to set up the whitespace commit hook locally type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Ezio Melotti added the comment: Configuring the editor to remove trailing whitespace, and using make patchcheck are other valid solutions to this problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Nick Coghlan added the comment: Sure, but both of those can fail (forgetting to run make patchcheck, using a different editor from your normal one for some reason) Once the commit hook is set up properly, you get alerted to the problem as soon as you try to commit, rather than having to untangle a merge chain when you realise on pushing that you stuffed up the whitespace in the original bugfix commit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16405] Explain how to set up the whitespace commit hook locally
Ezio Melotti added the comment: I'm not against your proposal. If the goal is to explain how to get rid of trailing whitespace then the other solutions should be mentioned too (I think made patchcheck already is). If the goal is to show how to set up local hooks and where to get them, then the other solutions don't belong there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com