svn提交时强制添加注释

时间:2023-04-19 17:42:50

1,找到Repositories 文件夹

2,在Repositories 中找到对应的工程,

3,在工程下找到hooks文件夹

4.在hooks文件夹下添加 :pre-commit.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