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

Re: How to prevent empty log messages?

From: Matthew Pounsett <matt_at_conundrum.com>
Date: Tue, 24 Jun 2008 10:52:28 -0400

On 16-Jun-2008, at 12:08 , Andy Levy wrote:

> The default pre-commit hook script template (pre-commit.tmpl in your
> repository's hooks directory) demonstrates exactly this. There are
> also numerous examples findable via Google and the SVN Users list
> archives.

A bit late to the thread, I realize. :)

The default pre-commit hook is useful, but I'd like to offer up this
modification of it, which will provide commandline clients with a
useful error message:

# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
TEXT=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]"`

if [ "x${TEXT}" = "x" ]; then
     echo "Empty commit message." 1>&2
     exit 1;
fi

I haven't (yet) tested this with tortoise or any other GUI client, so
I'm not sure how they'll behave with the returned error message. This
might be useful to some people though.

Matt

Received on 2008-06-24 16:53:09 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.