We have the following tools in place:
- Subversion (Version 1.5.9)
- Polarion (version 3.2.2)
Polarion is based on Subversion, so on every action that changes anything (which is often the case), Polarion will use a Subversion commit to change anything. All things are currently stored in one and only one repository, so every commit of every user (some 100-200 on the same repository) will trigger the pre-commit hook.
So what is the best strategy to provide pre-commit hooks that will
- trigger only for some, but not all projects
- run as fast as possible, because every pre-commit hook will block all other commits.
We have tried to implement pre-commit hooks with Java (using SVNKit), but this will start on every commit a Java VM. So any ideas how to implement that nicely?
If Java is slowing things down, but Java is only used a small percentage of the time, then I’d write the hook in something lightweight. i.e. on Windows, use a .bat file. Then, for the projects (or files or users) that require it, call the more expensive Java hook from the lightweight hook. That way, you’ll only slow down the Commit when it’s needed.