首页 > 代码库 > svn 设置强制要求注释

svn 设置强制要求注释

在svn的库数据文件的hooks文件夹下面 有pre-commit.tmpl,我们把它备份一下pre-commit-bk.tmpl,

然后新增加一个 pre-commit.bat,里面填入如下脚本 即可。

@echo offsetlocalset REPOS=%1set TXN=%2rem check that logmessage contains at least 5 characterssvnlook log "%REPOS%" -t "%TXN%" | findstr "....." > nullif %errorlevel% gtr 0 goto errexit 0:errecho Empty log message not allowed. Commit aborted! 1>&2exit 1