SVN Hook for pre-fixing for a specific folder

In one of our SVN client repositories, there are quite a few projects within the same repository. Now I want to check the standard coding for one of the projects using pre-commit bindings.

If I set up pre-commit, this will affect all projects (folders) in the repository, how can I call the hook script to run (check the encoding standard) only when the file is from a specific folder (or project).

UPDATE

The coding standard is intentional for Zend, and I intend to use PHPCS (PHP coding standard) to test the coding standard.

+6
source share
2 answers

Use svnlook in pre-commit to see path changes, and if the path contains the project you are considering, follow 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

Pre-commit example using svnlook: http://wordaligned.org/articles/a-subversion-pre-commit-hook

+6
source

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

+1
source

Source: https://habr.com/ru/post/895116/


All Articles