Try this :
rem Make sure that the log message contains some text.
set REPOS=%1
set TXN=%2
"C:\Program Files\Subversion\bin\SVNlook.exe" log -t %TXN% %REPOS% | FindStr [a-zA-Z0-9]
IF %ERRORLEVEL% EQU 0 GOTO OK
echo Your commit has been blocked because you didn't provide a 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 1>&2
exit 1
:OK
rem -------------------------------------------------------------
rem Check if comment is in list of reserved words to not be used..
rem -------------------------------------------------------------
"C:\Program Files\Subversion\bin\SVNlook.exe" log -t %TXN% %REPOS% >comment
setlocal enabledelayedexpansion
Set SEPARATOR=
set COMMENT=
for /f "delims=" %%a in (comment) do (
set currentline=%%a
set COMMENT=!COMMENT!%SEPARATOR%!currentline!
)
FIND "%COMMENT%" "C:\Program Files\Subversion\excludedwords.txt">Null
If %ERRORLEVEL% EQU 1 goto OK2
:Fail
echo Your commit has been blocked because the single word comment you provided is not allowed 1>&2
echo Line is -%COMMENT%- 1>&2
echo Please write a proper log message describing the purpose of your changes and 1>&2
echo then try committing again. -- Thank you 1>&2
exit 1
:OK2
rem -------------------------------------------------------------
rem Check number of words on the line if = 2 then reject comment
rem -------------------------------------------------------------
Set VAR1=%COMMENT%
Set count=0
For %%j in (%VAR1%) Do Set /A count+=1
IF %count% EQU 2 goto Fail2
goto OK3
:Fail2
echo Your commit has been blocked because not enough detail supplied 1>&2
echo Please write a longer log message describing the purpose of your changes and 1>&2
echo then try committing again. -- Thank you 1>&2
exit 1
:OK3
rem -------------------------------------------------------------
rem Check that the author of this commit has the rights to perform
rem -------------------------------------------------------------
rem the commit on the files and directories being modified.
rem commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1
rem All checks passed, so allow the commit.
exit 0