Article Title: how to run the hook script in Subversion. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Subversion is a powerful version control system, especially it can easily process data on various points in the library management process. You can own the script handle data after submission, before submission, or locking or unlocking a file, or in other cases. All of these are implemented through hooks, which are part of the subversion library structure. The Hook is triggered by a library event. For example, if you have a subversion inventory under/subversion/repos/packages, your hook will be stored in the/subversion/repos/packages/hooks directory.
A large number of temporary files are stored in this hook directory. These files exist only as examples. So if you want to write a script that sends the subversion data to you via e-mail after each commit, you should copy the post-commit.tmpl to post-commit, change it to executable and edit it as needed.
These scripts can be obtained from the subversion website, and some scripts and tools provided by other users. You can view many of these scripts on http://subversion.tigris.org/tools_contrib.html. Currently, the most interesting is the post-commit e-mail script commit-email.pl. Download the file and put it under/usr/local/bin/, and make it executable. In the hooks/post-commit script, add the following content to the end of the file:
REPOS = ""
REV = ""
/Usr/local/bin/commit-email.pl "$ REPOS" "$ REV" -- from svn@myhost.com-s
"SVN commit in packages" joe@myhost.com
This will execute the commit-e-mail.pl script with some parameters, that is, the Library name and your revision. It sends e-mail from the svn@myhost.com site to the joe@myhost.com Based on the specified theme route, and some specified users or email lists on the joe@myhost.com site.
If you want to view other scripts on the site, you can see many interesting scripts in the Manager of the version control software library. Before the entire data is submitted to subversion, these scripts can perform certain checks, such as various pre-commit check scripts.