Questions tagged [svn-hooks]

In Apache Subversion, a hook is a program triggered by some repository event, such as the creation of a new revision or the modification of an unversioned property. This is often used for integration of Subversion with other tools, e.g. bug tracking software.

Subversion hook is a program triggered by some repository event, such as the creation of a new revision or the modification of an unversioned property. This is often used for integration of Subversion with other tools, e.g. bug tracking software, for implementing custom policies and for e-mail notifications.

Hooks in Subversion are stored as a part of the repository on the Subversion server in a directory called "hooks". E.g. C:\Repositories\foobar\hooks\.

Helpful articles from the SVNBook:

  1. Subversion Repository Hooks (complete reference on each hook type)

  2. Implementing Repository Hooks

215 questions
3
votes
3 answers

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…
Nikolai Prokoschenko
  • 8,465
  • 11
  • 58
  • 97
3
votes
2 answers

Initialize rbenv and run ruby script from shell script

Initialize rbenv and run ruby script from shell script I want svnserve to run pre-commit hook, written on ruby. As the svnserve is run as root user, it knows nothing about user rbenv installation. I set a soft link /usr/bin/ruby ->…
sadfuzzy
  • 442
  • 5
  • 20
3
votes
2 answers

Why do I get 'Bad file descriptor' when trying sys.stdin.read() in subversion pre-revprop-change py script?

I'm trying pre-revprop-change hook script on a Windows machine, but find a tough problem. I distill my problem to the following scenario: I have C:\csvn\data\repositories\tr1\hooks\pre-revprop-change.bat with content: D:\svntest\testhook.py %* exit…
Jimm Chen
  • 3,411
  • 3
  • 35
  • 59
3
votes
2 answers

What options are available for VisualSVNServerHooks.exe?

VisualSVN Server provides an exe called VisualSVNServerHooks which has some command line configurable hooks but as best I can tell there's only a single pre-commit for checking the case sensitivity of file names and a single post-commit for sending…
Troy Hunt
  • 20,345
  • 13
  • 96
  • 151
2
votes
1 answer

Subversion hook updating externals autentification error

I have a post-commit hook that is updating a working copy. In that working copy some of the files are externals witch have authentication. Is there a way to pass the login credentials to the svn update only for the externals ? Right now it does the…
Gabriel Solomon
  • 29,065
  • 15
  • 57
  • 79
2
votes
1 answer

Subversion post-commit hooks access is denied

My system is Windows2008 R2 64bit, and i install VisutalSubversion Server. The post-commit.bat as the follow statement: C:\nant\bin\nant -buildfile:C:\Repositories\xxx\hooks\xxx.build When i commit file from client, it throw the errors post-commit…
sothicor
  • 43
  • 4
2
votes
1 answer

svn hook to generate file from committed files

I have an SVN repository that has trunk/file1.txt trunk/file2.txt trunk/fileR.txt On the server, I have a working copy checkout of trunk ( /var/www/trunk ) owned by user www-data . fileR.txt is read only for everyone except the user www-data…
cdavid
  • 497
  • 6
  • 11
2
votes
1 answer

Hook script to block commit of files having a particular string

I have implemented the below code in my hook script file abc-pre-commit.bat to disallow commit if files contain the string cod_bank SETLOCAL SET PATH=C:\Windows;C:\Windows\system32;D:\SCC\SVN146\ bin;C:\Program Files\VisualSVN Server\bin; set…
2
votes
2 answers

subversion pre-commit hook that requires user type 'y/n' in console?

I have a pre-commit hook working that checks that the message was not empty and requires at least x number of characters. We are using JIRA for tracking issues and are 'tagging' our issues in the commit message log. However, not every commit…
Nick Sinas
  • 2,594
  • 11
  • 42
  • 51
2
votes
2 answers

Insert revision information in a header file in VisualSVN

I would like to run some sort of post commit hook script on a VisualSVN server in order to either add a file (or simply edit a file) to the repository which will include the revision number (and other revision information). I know this is possible…
dudico
  • 555
  • 2
  • 4
  • 11
2
votes
3 answers

Getting project name in post-commit subversion hook

I have a subversion repository laid out like this: Repo ProjectA trunk branches tags ProjectB trunk branches tags I'm trying to write a post-commit hook script that just applies to one…
Erik W
  • 807
  • 9
  • 25
2
votes
1 answer

SVN: Python Pre-commit script always fails

I have found an example python script and have modified it to do checks for comments in pre-commit. My problem is that the text of the comment as parsed by python always ends up blank. Env: Windows XP SVN version: svn, version 1.5.6 (r36142)…
Lang
  • 21
  • 2
2
votes
2 answers

Subversion post commit to tags hook

I can have the post commit hook send out an email every time someone checks something, but can I limit that to only if people check something into the tags directory? Basically I want a notification when anyone promotes a release. My subversion is…
Andrew
  • 21
  • 1
2
votes
1 answer

svn subversion server list only repository (Takes To much time)

I have a problem with TIME when Im using svnlook tree /var/www/svn/TEST --full-paths| grep -E 'RV/13\.9\.4\.[0-9]+/$' /var/www/svn/TEST -> is quite big project has many folder and files. Explication: I listed only the repository that named like…
MokiNex
  • 857
  • 1
  • 8
  • 21
2
votes
1 answer

Need help with subversion's post-revprop-change hook

I have created post-commit and pre-commit hooks in subversion before but I cannot seem to successfully trigger a post-revprop-change hook. Here's how I post-revprop-change hook (and that's executable by the svn…
icasimpan
  • 1,253
  • 3
  • 16
  • 28