开发者

SVN Pre-commit hook to be triggered for a particular folder

One of our client's SVN repository has quite a bunch of projects under the single repository. Now I want to check coding-standard for one of the project via pre-commit hook.

If I configure the pre-commit, it is going to affect all the projects (folders) in the repository, how do I tell the hook-script to trigger (check the coding standard) only when a file from a particular folder (or project) 开发者_运维技巧is committed.

UPDATE

The coding standard is intentional for Zend and I am going to use PHPCS (PHP Coding Standard) to validate the coding-standard.


Use svnlook in the pre-commit to see the paths changed, and if the path contains the project you are considering, do the coding standards etc.

You can use the dirs-changed subcommand (and the --transaction flag):

http://svnbook.red-bean.com/en/1.5/svn.ref.svnlook.c.dirs-changed.html

Or the changed subcommand:

http://svnbook.red-bean.com/en/1.5/svn.ref.svnlook.c.changed.html

Example of a pre-commit using svnlook: http://wordaligned.org/articles/a-subversion-pre-commit-hook


You cannot. The script needs to check all the affected paths (they can be more than one) and act accordingly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜