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

Reply via email to