Visual SVN Server下 右鍵項目 「全部任務」》「Manage Hooks」 》選中Pre-commit hook而後edit編輯,添加以下代碼svn
@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