User:Evilpie/commit-restrictions: Difference between revisions

Jump to navigation Jump to search
Line 9: Line 9:
An example for a passing commit message would be,
An example for a passing commit message would be,


     Bug 577872 - Create WebM versions of Ogg reftests. r=kinetik<
     Bug 577872 - Create WebM versions of Ogg reftests. r=kinetik


notice the Bug ##### and the r=. Also the review is not checked at the moment, it could be at a
notice the Bug ##### and the r=. Also the review is not checked at the moment, it could be at a
Line 20: Line 20:
* Commit messages containing "no bug" (please use this sparingly)
* Commit messages containing "no bug" (please use this sparingly)
* Commit message indicates backout of a given 12+ digit changeset id, by starting with
* Commit message indicates backout of a given 12+ digit changeset id, by starting with
   <pre>(back out|backing out|backed out|backout)( of)? (rev|changeset|cset)s? [0-9a-f]{12}</pre>
 
   (back out|backing out|backed out|backout)( of)? (rev|changeset|cset)s? [0-9a-f]{12}
* Commit message starts with "merge" or "merging" and is actually a merge changeset.
* Commit message starts with "merge" or "merging" and is actually a merge changeset.


Line 47: Line 48:


Change your .hgrc to include:
Change your .hgrc to include:
<code>
<tt>
   [hooks]
   [hooks]
   pretxncommit.good_commit_message = python:goodCommitMessage.hook
   pretxncommit.good_commit_message = python:goodCommitMessage.hook
</code>
</tt>
You probably need to add good_commit_message to your Python path
You probably need to add good_commit_message to your Python path
<code>  export PYTHONPATH = ~/myhooks # assuming good_commit_message.py is in this folder</code>
<tt>   
    export PYTHONPATH = ~/myhooks # assuming good_commit_message.py is in this folder
</tt>
You can also edit good_commit_message.py to abort commits instead of warning.
You can also edit good_commit_message.py to abort commits instead of warning.
Confirmed users
149

edits

Navigation menu