名称

pre-commit — 在提交结束之前提醒。

描述

The pre-commit hook is run just before a commit transaction is promoted to a new revision. Typically, this hook is used to protect against commits that are disallowed due to content or location (for example, your site might require that all commits to a certain branch include a ticket number from the bug tracker, or that the incoming log message is nonempty).

If the pre-commit hook program returns a nonzero exit value, the commit is aborted, the commit transaction is removed, and anything printed to stderr is marshalled back to the client.

输入参数

传递给你钩子程序的命令行参数,按照顺序是:

  1. Repository path

  2. Commit transaction name

普通用户

Change validation and control