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

Re: Pre-commit script for Windows - Require log msg

From: Nathan Kidd <nathan-svn_at_spicycrypto.ca>
Date: 2006-03-01 20:12:38 CET

Young, Jason (GE Infrastructure) wrote:
> Does anyone have a pre-commit script for Windows that requires a log
> message to be entered? I know about the one included with subversion,
> but I would like something that runs direct if possible.

Try the attached. (You'll need to set %SVNLOOK%.
(I actually use a variant of this, with grep, which allows easy checking
things like a single space.)

> For that matter, is there a site that has a collection of hook scripts
> for Windows?

I don't know of any, but I'm sitting on a number of patches for
mailer.py and case-insensitive.py, making them work properly on win32
and with 1.2.x python bindings. I don't have time right now to submit
proper patches to dev@ but if you're interested I can post the full
versions somewhere.

-Nathan

@echo off
::
:: check-empty-log.cmd - Stops commits that have empty log messages.
::

setlocal

set "REPOS=%~1"
set "TXN=%~2"

:: Make sure that the log message contains some text.
for /f "tokens=*" %%i in ('%SVNLOOK% log -t "%TXN%" "%REPOS%"') do set "LOGMSG=%%i"
if not "%LOGMSG%"=="" exit 0

echo. 1>&2
echo Your commit has been blocked because you didn't give any log message! 1>&2
echo Please write a log message describing the purpose of your changes and 1>&2
echo then try committing again. -- Thank you, Your Loving Admins. 1>&2
exit 1

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Mar 1 20:14:58 2006

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.