#!/bin/sh REPOS="$1" TXN="$2" SVNLOOK=/usr/bin/svnlook #根据自己的svnlook目录填写 # check that logmessage contains at least 10 alphanumeric characters LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 10 ];#10是限制多少个字符 then
#上面这句作用是当提交失败时,输出的提示信息
fi
把以上代码写入到pre-commit.
注意:
1.hooks目录下没有pre-commit,只有pre-commit.tmpl,把其改成pre-commit (责任编辑:IT) |