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

Re: send error messages back to the client in hook scripts..

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-08-10 00:03:04 CEST

On Aug 9, 2007, at 16:48, aaron smith wrote:

> On 8/9/07, Rainer Sokoll wrote:
>
>> On Thu, Aug 09, 2007 at 04:55:05PM -0400, aaron smith wrote:
>>
>> > just trying a quick example.. here is my pre commit hook..
>> >
>> > #make sure that the log message contains some text.
>> > REPOS="$1"
>> > TXN="$2"
>> > SVNLOOK=/usr/bin/svnlook
>> > $SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null
>> || exit
>> > "Please enter a commit message"
>> >
>> > It denies me commits if no text is entered, but I don't see the
>> message, is
>> > this the correct way to send it back to the client? Thanks all..
>>
>> You have to use to STDERR, like this (example):
>>
>> $SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]"
>> if [ $? -ne 0 ] ; then
>> echo "Empty Log Messages not allowed - Yours sincerly, Aaron" >&2
>> exit 1
>> fi
>
> Hey man, really appreciate the example.. unfortunatley that didn't
> do it.. Maybe it's my client? I'm using TextMate with subversion,
> although it's strange as i've seen error messages come back to
> textmate previously.. I'm still looking for reasons why this isn't
> working..

Then please try using the svn command-line client, to get the unknown
TextMate out of the picture. Rainer's example should be correct.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Aug 10 00:02:22 2007

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