SVN的仓库目录下hooks里面创建pre-commit.bat文件:(不需要重启,直接生效)
内容如下(注意其中的SVN_BINDIR路径,可能需要改一下)
@echo off
setlocal
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
rem .....代表5个字符
svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul
if %errorlevel% gtr 0 goto err
exit 0
:err
echo Empty log message not allowed. Commit aborted! 1>&2
exit 1