svn服务器配置

log的提交格式检查

修改svn server目录下hooks下的pre-commit.tmpl

/home/svn/work/hooks/pre-commit.tmpl

#!/bin/sh

REPOS="$1"
TXN="$2"

SVNLOOK=/usr/bin/svnlook

LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` 
if [ "$LOGMSG" -lt 20 ]
then 
  echo "\n 20个字符都懒得写,以后日志还能看吗?" 1>&2 
  exit 1 
fi 

# Make sure that the log message contains some text.
$SVNLOOK log -t "$TXN" "$REPOS" | grep "^module:\|^merge:\|^compile:\|^bug#[0-9]\{5,6\}:" > /dev/null 

if [ $? -ne 0 ]
then     
    echo "\n一次两次三四次,五次六次七八次,不按规矩写的,你想干啥?!" 1>&2 
	exit 1
fi 


exit 0
然后将pre-commit.tmpl改名为pre-commit
相关文章

相关标签/搜索