1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

CVS Pre- and Post-Commit Scripts

CVS is capable of running server-side scripts prior to writing commit changes to a repository, and/or immediately after a commit.

SourceForge.net maintains a central install of the cvs_acls and syncmail scripts in the /cvsroot/sitedocs/CVSROOT/cvstools directory on the CVS server. You can make use of one of these scripts instead of creating your own script, if they meet your needs.

To install and use a script

  1. Checkout a copy of the 'CVSROOT' module for your project. This module is present by default in all CVS repositories, and contains files that affect the management of your project's normal CVS files.
       cvs -d:ext:USERNAME@PROJECTNAME.cvs.sourceforge.net/cvsroot/PROJECTNAME co CVSROOT
    
  2. If you're creating a script, place the script inside this checked-out CVSROOT directory:
    1. Set the permissions on the script to be executable. (CVS does not allow you to change permissions after a commit without manually administering your repository files.)
    2. Use CVS to add the script the 'CVSROOT' module (cvs add NAME).
    3. Modify the 'checkoutlist' file in the 'CVSROOT' module to include the filename of the script on a single line by itself. This ensures that a checked-out version of the script is made available to be run inside your CVSROOT directory on the server.
    4. Commit the changes to the repository.
  3. To start using your script (either a newly-created one, or one of the scripts provided by SourceForge.net):
    1. Modify either the 'commitinfo' or 'loginfo' file in the CVSROOT directory to include a line referencing the script:
      • If the script should be run before the commit, modify commitinfo.
      • If the script should be run after the commit, modify loginfo.
    2. Commit the changes that reference the script.
    3. Perform a normal commit to test the functionality of the script.

If you accidentally break access to your repository while installing hook scripts, you may repair the repository using the interactive shell service.

Supported scripting languages

  • Shell scripting languages: /bin/bash; /bin/tcsh; /bin/zsh; /bin/ksh
  • Perl: `/usr/bin/perl
  • Python 2.x: /usr/bin/python
  • Ruby: /usr/bin/ruby

Getting Help