On Sun, 2007-09-16 at 02:48 +0200, Maddes wrote:
> I now what you are looking for, and it is fairly easy with some
> scripting knowledge.
>
> My pre-commit hook looks like the following on Linux, where I also do
> all the checks possible and only exit at the end, as I don't want the
> user to commit and get the first error, commit again and get the second
> error, and so on, that's why I "add" the errors.
That sounds reasonable...
>
> declare -i RC_ALL=0
>
> # Make sure that the log message contains some text.
> $SVNLOOK log -t "$TXN" "$REPOS" | \
> grep "[a-zA-Z0-9]" > /dev/null \
> || { RC_ALL+=1; echo -e "$0:\nLog message empty!!!\n " 1>&2; }
>
> ...
>
> # All checks done
> echo All checks done. RC=${RC_ALL} 1>&2
>
> # Enable next line when testing
> #RC_ALL=999
>
> exit ${RC_ALL}
I have incorporated your script into mine... but now I get:
----------------------
svn: 'pre-commit' hook failed with error output:
declare: not found
RC_ALL+=1: not found
svn: MERGE of '/path/to/repo/project': 409 Conflict
(http://svn.example.com)
----------------------
My script now looks like this...
----------------------
#!/bin/sh
REPOS="$1"
TXN="$2"
declare -i RC_ALL=0
# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
grep "[a-zA-Z0-9]" > /dev/null \
|| { RC_ALL+=1 echo -e "$0:\nLog message empty!!!\n " 1>&2; }
# All checks done
exit ${RC_ALL}
----------------------
Any ideas?
/Jette
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Sep 17 20:38:06 2007