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

SVN: pre-commit, I give up. Help!

From: Res Pons <pons32_at_hotmail.com>
Date: 2007-03-23 07:06:36 CET

Hi everyone

I give up. My new pre-commit script does not work. I even included a final
echo stmt and an exit code of 1 to cause it failure but when I check out the
"testproject" and another project, I can, in either project, do [svn ci -m
"comment" . ] and svn continues regardless and checks in the file anyway as
seen below:

Transmitting file data .
Committed revision 234.

Here's a copy of my pre-commit:

sudo vi pre-commit

# A pre-commit hook script to ensure that no changes are commited to the
# repository without a valid comment

TESTPROJECT=`echo $REPO | $GREP '/testproject/trunk/'`

        if [[ "$TESTPROJECT" ]]; then

                #make sure that the comment starts with a bug number and
contains some text.
                $SVNLOOK log -t "$TXN" "$REPO" | $GREP '^[[:digit:]]' >

                if [[ $result -ne 0 ]]; then

                        echo -n "You must start your comment with a bug
number, aborting..." 1>&2
                        exit 1


        elif [[ "$TESTPROJECT" = "" ]]; then

                #if the project is non-testproject, no bug# necessary, just
force an alphanum comment
                $SVNLOOK log -t "$TXN" "$REPO" | $GREP "[a-zA-Z0-9]" >

                if [[ $result -ne 0 ]]; then

                        echo -n "You must enter an alphanumeric comment,
aborting..." 1>&2
                        exit 1



                echo "Submission was successful." 1>&2
                exit 0


echo "WTF?" 1>&2

5.5%* 30 year fixed mortgage rate. Good credit refinance. Up to 5 free
quotes - *Terms

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Mar 23 07:07:02 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.