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

Re: How to force comments on SVN commit

From: Dave Peters <gameslover987_at_yahoo.com>
Date: Fri, 29 May 2009 12:31:26 -0700 (PDT)

Thanks for the suggestion and I made the change on the file. However, I still got the same error.

Error: Commit failed (details follow):
Error: MERGE request failed on 'Support/code/Dev'
Error: 'pre-commit' hook failed with error output:
Error: Please provide a meaningful comment when committing changes.

Any help is appreciated.

Thanks. --DP

Here is the file
#!/bin/sh

REPOS="$1"
TXN="$2"

SVNLOOK=/usr/bin/svnlook
GREP=/bin/grep
WC=/usr/bin/wc

LOGMSG=`$SVNLOOK log -t $TXN $REPOS | $GREP [a-zA-Z0-9] | $WC -c`

if [ "$LOGMSG" -lt 5 ]; then
echo -e Please provide a meaningful comment when committing changes.. 1>&2
exit 1
fi

#/hooks/commit-access-control.pl "$REPOS" "$TXN" /hooks/commit-access-control.cfg || exit 1

exit 0

--- On Thu, 5/28/09, Ryan Schmidt <subversion-2009b_at_ryandesign.com> wrote:

> From: Ryan Schmidt <subversion-2009b_at_ryandesign.com>
> Subject: Re: How to force comments on SVN commit
> To: "Dave Peters" <gameslover987_at_yahoo.com>
> Cc: "David Weintraub" <qazwart_at_gmail.com>, users_at_subversion.tigris.org
> Date: Thursday, May 28, 2009, 6:32 PM
> On May 28, 2009, at 15:08, Dave
> Peters wrote:
>
> > I got the following errors when I commit the changes:
> >
> > Error: Commit failed (detailed follow):
> > Error: MERGE request failed on 'Support/code/Dev'
> > Error: 'pre-commit' hook failed with error output
> >
> >
> > *************************
> > Here is the pre-commit file:
> > !/bin/sh
> >
> > REPOS="$1"
> > TXN="$2"
> >
> > SVNLOOK=/usr/bin/svnlook
> >
> > LOGMSG=`$SVNLOOK log -t $TXN $REPOS | grep [a-zA-Z0-9]
> | wc -c`
> >
> > if [ "$LOGMSG" -lt 5 ]; then
> > echo -e Please provide a meaningful comment when
> committing 
> > changes.. 1>&2
> > exit 1
> > fi
> >
> > commit-access-control.pl "$REPOS" "$TXN"
> commit-access-control.cfg 
> > || exit 1
> >
> > exit 0
>
> Not only do you need to use the full path to svnlook as you
> do, but 
> you also need to use the full path to any other binary or
> script you 
> use, including grep, wc and commit-access-control.pl.
> Remember that 
> PATH is empty while the hook script runs so it doesn't know
> where to 
> find anything.
>
> echo is a shell built-in so you shouldn't need to use a
> full path for 
> that.
>
> Also, maybe this was just a copy/paste error, but the first
> line of 
> the script must begin with "#!" not just "!".
>
> Finally, make sure the script is called "pre-commit" (with
> no 
> extension) and has execute permission, for example use
> "chmod 755 pre-
> commit".
>
> So:
>
>
> #!/bin/sh
>
> REPOS="$1"
> TXN="$2"
>
> SVNLOOK=/usr/bin/svnlook
> GREP=/usr/bin/grep
> WC=/usr/bin/wc
>
> LOGMSG=`$SVNLOOK log -t $TXN $REPOS | $GREP [a-zA-Z0-9] |
> $WC -c`
>
> if [ "$LOGMSG" -lt 5 ]; then
> echo -e Please provide a meaningful comment when committing
> changes.. 
> 1>&2
> exit 1
> fi
>
> #commit-access-control.pl "$REPOS" "$TXN"
> commit-access-control.cfg 
> || exit 1
>
> exit 0
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2356605
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
>

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-05-29 21:32:25 CEST

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.