pre-commit — 在提交结束之前提醒。
pre-commit
钩子在事务创建新版本之前运行。通常这个钩子是用来保护因为内容或位置(例如,你要求所有到一个特定分支的提交必须包括一个 bug 追踪的 ticket
号,或者是要求日志信息不为空)而不允许的提交。
如果 pre-commit
钩子返回非零值,提交会终止,提交事务被删除,所有
stderr
的输出会返回到客户端。
传递给你钩子程序的命令行参数,按照顺序是:
版本库路径
提交事务的名称
Additionally, Subversion passes any lock tokens provided by the committing
client to the hook script via standard input. When present, these are
formatted as a single line containing the string
LOCK-TOKENS:
, followed by additional lines—one per
lock token—which contain the lock token information. Each lock token
information line consists of the URI-escaped repository filesystem path
associated with the lock, followed by the pipe (|
)
separator character, and finally the lock token string.