CVS Hook Scripts

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. 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

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 co CVSROOT

If you're creating a script, place the script inside this checked-out CVSROOT directory:
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.)
Use CVS to add the script the 'CVSROOT' module (cvs add NAME).
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.
Commit the changes to the repository.
To start using your script (either a newly-created one, or one of the scripts provided by
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.
Commit the changes that reference the script.
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


Documentation: CVS

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks