首页 > 代码库 > pre-commit脚本--commit前必须填写messages

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

#!/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