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

Hook Scripts; How to Send Message to User?

From: Tom Browder <tom.browder_at_gmail.com>
Date: Tue, 9 Jun 2009 10:17:30 -0500

I have a pre-commit hook script that is properly aborting the commit
according to my rules, but I can't get the script's message to the
user.

The book says anything written to stderr is marshalled to the user,
but I can't find any examples of how to do that successfully.

I have this in my hooks/pre-commit

===>
# Check that the incoming files meet name requirements.
/path/to/check-allowed-names.pl $1 $2 > /dev/null 2>&1
if [ $? != '0' ] ; then
  cat /path/to/msg 2>&1
  exit 1
fi
<===

Then I try to commit a file with disallowed name:

$ svn ci badname -m"test"
Adding (bin) badname
Transmitting file data .svn: Commit failed (details follow):
svn: Commit blocked by pre-commit hook (exit code 255) with no output.
$

The Perl script called by pre-commit writes to STDERR.

I have tried writing to an explicit file and then using cat in
pre-commit, but I can't control its output message at all.

What am I doing wrong? How does one get the called script's error
messages to the user?

Thanks.

-Tom

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2360658

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-09 17:18:33 CEST

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