在庫下的hooks目錄裏,建立腳本pre-commit,內容爲:bash
#!/bin/sh #必須填寫註釋且很多於5個字 REPOS="$1" TXN="$2" # Make sure that the log message contains some text. SVNLOOK=/usr/bin/svnlook LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 5 ];#要求註釋不能少於5個字符,您可自定義 then echo -e "請認真填寫提交註釋信息,很多於5個字!" 1>&2 exit 1 fi exit 0