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
2
votes
1 answer

How to create the hooks directory

We have a pre-existing SVN repository. Whoever created it did not follow the SVN standard directory structure and so there is no hooks folder. Is there a way to tell SVN to regenerate the hooks folder? If not, is there a way to create a directory…
TheChemist
  • 352
  • 2
  • 12
2
votes
1 answer

How to create a pre-commit hook in SVNto limit file size?

I am new in creating pre-commit hooks on SVN. Is there anyone who knows how to limit file size that being committed to SVN? I am currently using TortoiseSVN.
2
votes
1 answer

Perl SVN hook with czech characters

I downloaded the sample SVN post-commit hook provided by Slack integration. #!/usr/bin/perl use warnings; use strict; use HTTP::Request::Common qw(POST); use HTTP::Status qw(is_client_error); use LWP::UserAgent; use JSON; my $repository =…
Jan Richter
  • 1,976
  • 4
  • 29
  • 49
2
votes
3 answers

VisualSVN post-commit hook with batch file

I'm running VisualSVN on a Windows server. I'm trying to add a post-commit hook to update our staging project whenever a commit happens. In VisualSVN, if I type the command in the hook/post-commit dialog, everything works great. However, if I make a…
BDW
  • 612
  • 1
  • 8
  • 20
2
votes
1 answer

Subversion pre-commit hook to clean XML from WebDAV autoversioning client

I know that it isn't normally safe to modify a commit from a pre-commit hook in Subversion because SVN clients will not see the version that has been committed, and will cache the wrong thing, but I'd like to clean the code from a versioning-naïve…
rjmunro
  • 27,203
  • 20
  • 110
  • 132
2
votes
1 answer

get only author name for revision SVN for Windows

I am writing post-commit-hook script for svn repository for windows. I have a .bat file for this. Now I want to get only the author name for a revision, how to do this? I know svn info -r revnumber gives me information for particular…
Foolish
  • 3,952
  • 33
  • 46
2
votes
1 answer

post commit failed on SVN tortoise

I get a SVN post commit failed: Error msg is : post-commit hook failed (exit code 255) with no output. I tried few different scenerios: 1) Login putty as root and run the cmd in post-commit manually, able to execute the cmd successfully. 2) Login…
redcoder
  • 2,233
  • 4
  • 22
  • 24
2
votes
2 answers

Commit blocked by pre-commit hook (exit code 2) - target folders not allowed

While trying to commit the /trunk, I'm getting the following error: Sending content : E:\something\abc.log Error : Commit failed (details follow): Error : Commit blocked by pre-commit hook (exit code 2) with…
Nidheesh
  • 4,390
  • 29
  • 87
  • 150
2
votes
2 answers

How to create multiple post-commit hooks on Visual SVN

I have VisualSVN Server running on my server and I have created a post-commit hook to send an email to me when someone commits code, using the steps outlined here: http://www.visualsvn.com/support/topic/00018/ However, I would like to be able to…
dleerob
  • 4,951
  • 4
  • 24
  • 36
2
votes
2 answers

How to use svnlook in svn to search changed items

Could you please guide me on how svnlook is working below. I want to include this in a hook to prevent commits in a tag under /tags: $SVNLOOK changed -t "$TXN" "$REPOS" | grep "^U\W.*\/tags\/" && /bin/echo "Cannot commit to tags!" 1>&2 && exit 1
Kaku
  • 119
  • 2
  • 11
2
votes
2 answers

How to Run a subversion post-commit hook as low-priority separate thread

I have a long-running post-commit hook that updates an index of subversion repository (from the project http://svnquery.tigris.org/) The postcommit hook already runs as a separate thread due to the RunDetached executable provided as part of…
Nathan
  • 10,593
  • 10
  • 63
  • 87
2
votes
1 answer

TortoiseSVN post-commit.bat doesn't work

I am using TortoiseSVN on Windows 7 x64. I tried to put a post-commit.bat in the hooks folder of a repository, but it doesn't work at all. So I tried to put a pre-commit.bat (the content is exact the same as post-commit.bat) in hooks, and it worked…
user565739
  • 1,302
  • 4
  • 23
  • 46
2
votes
3 answers

Subversion email commit notification without hooks

I would like to receive email notifications of updates on an svn repository. I know that the standard solution for this is to use hooks, but I do not have access to the machine which hosts to the repository. Right now, I have written a one-liner to…
a3nm
  • 8,717
  • 6
  • 31
  • 39
2
votes
2 answers

help with subversion (svn) hook script

How to create a subversion server hook script that prevents people from committing changes if they don't own the lock on the file first? Svn server is on windows. Thanks. P.S. Additional info in this question Subversion (svn + tortoiseSvn) commit…
Irfan Mulic
  • 1,186
  • 3
  • 14
  • 28
2
votes
3 answers

Subversion whitespace-removal commit hook

Jeff Atwood wrote about whitespace and suggested creating commit hook which removes trailing whitespace at the ends of lines and files. I've searched, but I haven't found a clear example of using a pre-commit hook to modify files like this. Do you…
a paid nerd
  • 30,702
  • 30
  • 134
  • 179