码迷,mamicode.com
首页 > 其他好文 > 详细

pre-commit脚本--commit前必须填写messages

时间:2017-05-04 23:13:09      阅读:309      评论:0      收藏:0      [点我收藏+]

标签:pre-commit   钩子   强制写日志   

#!/bin/sh


repos="$1"

txn="$2"


res="ok"

# make sure that the log message contains some text.

svnlook=/usr/local/svn/bin/svnlook

$svnlook log -t "$txn" "$repos" | egrep "[^[:space:]]+" >/dev/null || unset res

if [ "$res" != "ok" ]

then

    echo "you must input some comments for you commit" >&2

    exit 1

fi


# all checks passed, so allow the commit.

exit 0 


pre-commit脚本--commit前必须填写messages

标签:pre-commit   钩子   强制写日志   

原文地址:http://mysky0708.blog.51cto.com/474802/1922181

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!