visualSVN提交强制添加注释
Visual SVN Server下 右键项目 “所有任务”》“Manage Hooks” 》选中Pre-commit hook然后edit编辑,添加如下代码
@echo off setlocal set REPOS=%1 set TXN=%2 rem check that logmessage contains at least 10 characters rem ...代表3个字符 svnlook log "%REPOS%" -t "%TXN%" | findstr "..." > nul if %errorlevel% gtr 0 goto err svnlook log "%REPOS%" -t "%TXN%" | findstr /ic:" " > nul if %errorlevel% gtr 0 goto success echo 提交失败,不允许空字符注释. 1>&2 exit 1 :err echo 提交失败,请添加注释! 注释长度至少为3个字符. 1>&2 exit 1 :success exit 0
纸上得来终觉浅,绝知此事要躬行