[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Hook Scripts; How to Send Message to User?

From: Greg Thomas <thomasgd_at_omc.bt.co.uk>
Date: Wed, 10 Jun 2009 11:29:24 +0100

On Wed, 10 Jun 2009 05:20:28 -0500, Tom Browder
<tom.browder_at_gmail.com> wrote:

>A complete example of a hook-script calling another script would be
>very helpful.

I've a number of hook scripts written in Perl (called
"pre-commit-something.pl") as I find it easier to keep the individual
functionality separate. The attached pre-commit hook script simply
calls them. I'll leave it to your imagination to change it for post
commit hooks - where the return code isn't required.

#!/usr/bin/bash

export PERL=/usr/bin/perl

EXIT_CODE=0

for HOOK in ${0%`basename $0`}pre-commit-*.pl; do $PERL $HOOK $1 $2;
if [[ $? -ne 0 ]]; then EXIT_CODE=1; fi; done

exit $EXIT_CODE

-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2360865
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-10 12:30:22 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.