Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving time in SVN post-commit hooks?

At my place of work we've started to introduce proper SVN hooks, "proper" meaning "doing a lot of policy checking". Currently, our policy consists of Perl::Critic with Perl::Tidy checking enabled. However, especially the latter one takes a lot of time on commits with several to many files touched and SVN wouldn't return until the post-commit hook is done.

Is there any way I can save some time in the post-commit hook without sacrificing policy checks?

like image 995
Nikolai Prokoschenko Avatar asked Jun 28 '26 01:06

Nikolai Prokoschenko


2 Answers

If you only need some report (like list of errors) then you can use Continious Intergation system run some post commit actions. This systems allow to put any action after changes in your source control system made. Here is example scenario:

  • Some one commit to SVN repository
  • After some time CC founds this change and runs the script:
    • Get latest version from SVN
    • Run checks like Perl::Critic and Perl::Tidy
  • If any check failed then
    • Create detailed error report (which is available from web)
    • Send email notification if necessary

There are many good Continious Intergation system. I like Hudson.

like image 68
Ivan Nevostruev Avatar answered Jun 29 '26 21:06

Ivan Nevostruev


This is another place where branch-based development can be useful. Essentially you create a new branch for each task you want to do. The branch is exempt from the quality checks, but the merge to trunk or whatever is not. So your day-to-day commits are fast, and it's only slow to merge. And you can reduce the pain of that by putting together a bot to do that task for you.

like image 38
retracile Avatar answered Jun 29 '26 23:06

retracile