I seem to be getting nowhere with this. Either searching the web for a script, etc. Anyone got a script that you can just edit the out-of-box pre-commit.tmpl in a Windows environment that requires x chars to be entered in for a comment on commit in Tortoise Subversion globally so that all members on the team are required whereas this requirement is pushed down to the clients from SVN server?
I don't know the scripting language and this should be something pretty damn simple without me taking the time to figure out scripting for the next 3 hours.
I have a pre-commit hook that can do exactly what you want. Plus a lot more.
It also allows you to do the following:
svn cp
, but not commit any changes. This is perfect for the/tags
directory where you are allowed to make a tag, but not modify the tag.And, it also allows you to do this:
svn:ignore
is set, so users don't accidentally commit in files they shouldn't commit.svn:log
must match certain regular expressions.This pre-commit script is written in Perl. By default, Perl comes with Unix, Mac, and Linux servers. Unfortunately, it isn't included on Windows computers. Fortunately, there are several open source, free, and easy to install Perl packages for the PC such as ActivePerl and Strawberry Perl
On Windows, you can use the
VisualSVNServerHooks.exe check-logmessage
pre-commit hook that comes with VisualSVN Server and is located in the%VISUALSVN_SERVER%bin
directory. This simple tool will help you define the minimum allowed number of characters in the log message.See the article KB140: Validating commit log messages in VisualSVN Server for instructions.
I use SubversionNotify, it probably does more than what you need, but is pretty simple to set up.
This is a .bat file to require there is a comment. It checks for the existence of at least one character in the comment.
This file sits in the /hooks folder of the repository, named pre-commit.bat. If you need a minimum amount of characters, the line to modify is
So if you wanted a minimum of 10 characters, you need to have 10 .'s rather than just one
More advanced options for the findstr command will let you do fancier checks (certain character sets, ect)
Try this :