Windows服务器svn提交必须加注释

一、svn提交代码时必须写注释

新建 pre-commit.bat 文件,内容如下:

@echo off
set SVNLOOK="C:\svn\VisualSVN Server\bin\svnlook.exe"
setlocal
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
%SVNLOOK% log "%REPOS%" -t "%TXN%" | findstr ".........." > nul
if %errorlevel% gtr 0 goto err
exit 0
:err
echo Empty log message not allowed. Commit aborted! 1>&2
exit 1

将SVNLOOK中的路径更换为自己的svn服务安装路径

将该文件复制到Repositories下项目中的hooks路径下即可,如:C:\svn\Repositories\test\hooks

你可能感兴趣的:(Java)