[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: Rainer Sokoll <R.Sokoll_at_intershop.de>
Date: 2007-08-09 23:05:03 CEST

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

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Aug 9 23:03:24 2007

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