Login | Register
My pages Projects Community openCollabNet

Discussions > users [DISABLED] > Re: Hook Scripts; How to Send Message to User?

subversion
Discussion topic

There will be a brief maintenance window every Friday at 17:00 Pacific.
For further details, see CollabNet's maintenance and upgrade policy.

Back to topic list

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

Author Greg Thomas <thomasgd at omc dot bt dot co dot uk>
Full name Greg Thomas <thomasgd at omc dot bt dot co dot uk>
Date 2009-06-10 03:29:31 PDT
Message On Wed, 10 Jun 2009 05:20:28 -0500, Tom Browder
<tom dot browder at gmail dot 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.

« Previous message in topic | 6 of 7 | Next message in topic »

Messages

Show all messages in topic

Hook Scripts; How to Send Message to User? Tom Browder <tom dot browder at gmail dot com> Tom Browder <tom dot browder at gmail dot com> 2009-06-09 08:17:33 PDT
     Re: Hook Scripts; How to Send Message to User? David Weintraub <qazwart at gmail dot com> David Weintraub <qazwart at gmail dot com> 2009-06-09 08:26:31 PDT
         Re: Hook Scripts; How to Send Message to User? Tom Browder <tom dot browder at gmail dot com> Tom Browder <tom dot browder at gmail dot com> 2009-06-09 14:00:41 PDT
     Re: Hook Scripts; How to Send Message to User? ryandesign Ryan Schmidt 2009-06-09 17:19:50 PDT
         Re: Hook Scripts; How to Send Message to User? Tom Browder <tom dot browder at gmail dot com> Tom Browder <tom dot browder at gmail dot com> 2009-06-10 03:20:40 PDT
             Re: Hook Scripts; How to Send Message to User? Greg Thomas <thomasgd at omc dot bt dot co dot uk> Greg Thomas <thomasgd at omc dot bt dot co dot uk> 2009-06-10 03:29:31 PDT
             Re: Hook Scripts; How to Send Message to User? ryandesign Ryan Schmidt 2009-06-10 14:10:59 PDT
Messages per page: