SVN设置没有写log不能commit

时间:2022-09-06 15:21:01

 

操作方法:在SVN的Repositories下,找到要配置的项目,在项目目录下找到hooks文件夹,在其下创建pre-commit.bat文件,把下面复制进去就可以了(无需重启,如果改动,保存bat文件,配置就生效):

@echo off
setlocal
set SVN_BINDIR=C:/Program Files/VisualSVN Server/bin
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul
endlocal
if %errorlevel% gtr 0 goto err
exit 0
:err
echo please input log message ,at least 10 characters(请认真填写注释信息,至少5个汉字). Commit aborted! 1>&2

exit 1