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

Re: pre-commit on Windows: Minimum Size log-message?

From: Jody Shumaker <jody.shumaker_at_gmail.com>
Date: 2006-04-30 07:23:50 CEST

On 4/29/06, Pieter Coucke <pietercoucke@hotmail.com> wrote:
> Hi,
>
> I'm trying to have a pre-commit hook on Windows (without the need of
> installing other applications), that forces the users to have a minium
> log-message size of a given number of characters.
>
> I found one that checks if there is a log-message, but not if it has enough
> characters.
>
> Does anybody has one?
> And is there somewhere a 'library' whith pre-commit-scripts for Windows?
>
> Thanks a lot in advance,
>
> Pieter
>
> PS: This should be in a SVN-newsgroup and not in a TortoiseSVN-newsgroup,
> but I didn't find one... In case it exists or there is a better place for
> aksing this: it would be great if you could point me out.

http://subversion.tigris.org/
In the menu on the right you click on "Mailing lists" Which happens to
be the exact same layout as the link for this e-mail list on
http://tortoisesvn.tigris.org/

> PS2: The one I found:
> http://donie.homeip.net:8080/pebble/Steve/2006/02/27/1141079943879.html
> @echo off
>
> setlocal
> set REPOS=%1
> set TXN=%2
>
> rem check for an empty log message
> svnlook log "%REPOS%" -t "%TXN%" | findstr "." > nul
> if %errorlevel% gtr 0 goto err
> exit 0
>
> :err
> echo You must provide a log message. 1>&2
> exit 1
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
> For additional commands, e-mail: users-help@tortoisesvn.tigris.org
>
>

Doing a quick findstr /? on the command prompt shows me it works as a
regular expression. This means you could modify the 'findstr "."'
above to match whatever you want. for example, this would match any
log message with 5+ characters:
svnlook log "%REPOS%" -t "%TXN%" | findstr "....." > nul

Depending on its regex support you might be able to do
svnlook log "%REPOS%" -t "%TXN%" | findstr ".{7,7}" > nul
to match a nice simple #, but I don't know findstr's specific support
and my regex knowledge is rusty.

- Jody

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Sun Apr 30 07:23:57 2006

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.