What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!
Windows pre-commit hook to check that log contains something.
@ECHO OFF
setlocal
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Get subversion arguments
set repos=%~1
set txn=%2
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Set some variables
set svnlookparam="%repos%" -t %txn%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Make sure that the new svn:log message contains some text.
set bIsEmpty=true
for /f "tokens=* usebackq" %%g in (`svnlook log %svnlookparam%`) do (
set bIsEmpty=false
)
if '%bIsEmpty%'=='true' goto ERROR_EMPTY
echo Allowed. >&2
goto :END
:ERROR_EMPTY
echo Empty log messages are not allowed. >&2
goto ERROR_EXIT
:ERROR_EXIT
:: You may require to remove the /b below if your hook is called directly by subversion
exit /b 1
:END
endlocal