Re: pre-commit hooks does not show any output

"Mathias Weinert" <[email protected]> Thu, 27 Oct 2005 15:43:59 +0200
Newsgroups gmane.comp.version-control.subversion.devel,gmane.mail.eyebrowse.user
Message-ID <[email protected]>
Claudio Ochoa <[email protected]> wrote:

> Damn! forget about my message, there was nothing wrong with the pl 
> scritp. I used the pre-commit template and I didn't see these lines
> 
> # Make sure that the log message contains some text.
> SVNLOOK=/usr/bin/svnlook
> $SVNLOOK log -t "$TXN" "$REPOS" | \
>     grep "[a-zA-Z0-9]" > /dev/null || exit 1
> 
> and of course, my commit was with an empty message, so never reached the 
> access control.

Perhaps the script should be changed that it will tell
you about an empty log message, e. g. like this:

--- pre-commit.tmpl     2005-10-20 16:13:57.784377800 +0200
+++ pre-commit  2005-10-27 15:40:01.295230300 +0200
@@ -59,8 +59,14 @@

 # Make sure that the log message contains some text.
 SVNLOOK=/usr/local/bin/svnlook
+SVNLOOKOK=1
 $SVNLOOK log -t "$TXN" "$REPOS" | \
-   grep "[a-zA-Z0-9]" > /dev/null || exit 1
+   grep "[a-zA-Z0-9]" > /dev/null || SVNLOOKOK=0
+
+if [ $SVNLOOKOK = 0 ]; then
+  echo Empty log messages are not allowed. Please provide a proper log message. >&2
+  exit 1
+fi

 # Check that the author of this commit has the rights to perform
 # the commit on the files and directories being modified.


> 
> Sorry about that!
> 

No problem.

> Thanks anyway for your help!

You're welcome.

Mathias