Search code examples
svnsvn-hooks

On subversion hooks, how the post commit template is getting generated inside hooks folder?


Some post-commit tmpl uses commit-email.pl while others use mailer.py by default. Could you tell me how this works?


Solution

  • So I will give it a try. The following is happening when you create a new Subversion repository (of course depending on the tool and version you are using, that may be different)

    1. The server administrator starts in the shell the command svnadmin create <repo-name>.
    2. Depending on the infrastructure (Apache, svnserve, ...) the administrator has to add configuration to the middleware, so that repository may be accessed.
    3. As part of that creation, the directory hooks was created, with the default entries of Subversion. These have all the suffix .tmpl which means that none of the hooks is active by default.
    4. By renaming the hook files to the real name ( pre-commit instead of pre-commit.tmpl), the hook is activated in will be used by Subversion.

    So it is the decision of the administrator which hook to use (if any), Subversion provides only examples or default implementations that may be activated by the administrator.

    See http://svnbook.red-bean.com/en/1.7/svn.reposadmin.create.html with the section "Implementing Repository Hooks" for details.