通过定制 pre-commit 禁止提交空注释的代码 ::-- ZoomQuiet [2007-08-04 14:50:43]

Contents

  1. 反馈

CPUG联盟::

CPUG::门户plone

BPUG

SPUG

ZPUG

SpreadPython Python宣传

# PRE-COMMIT HOOK
#
# The pre-commit hook is invoked before a Subversion txn is
# committed.  Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-commit' (for which
# this file is a template), with the following ordered arguments:
#
#   [1] REPOS-PATH   (the path to this repository)
#   [2] TXN-NAME     (the name of the txn about to be committed)
#


REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
   grep "[a-zA-Z0-9]" > /dev/null 

if [ $? != 0 ]; then
        echo "$TXN $REPOS" 1>&2
        echo "Alert! Commit message can not be empty." 1>&2
        exit 1
fi

exit 0

1. 反馈

SubVerSion/AntiEmptyCi (last edited 2009-12-25 07:16:41 by localhost)