X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgithooks.txt;h=28a8abcf52b0c4180a132d4093b6b8a59c63c6fd;hb=9b27ea95189b1f276c9f7e10df81fa1476a4ad4d;hp=046a2a7fe7cf8ec301d3a20f7ebc587a09d210e3;hpb=fc721b699b817e9cb78994c6dd6d86e744bd2112;p=git.git diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 046a2a7fe..28a8abcf5 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -20,6 +20,10 @@ directory to trigger action at certain points. When all disabled. To enable a hook, rename it by removing its `.sample` suffix. +NOTE: It is also a requirement for a given hook to be executable. +However - in a freshly initialized repository - the `.sample` files are +executable by default. + This document describes the currently defined hooks. applypatch-msg @@ -86,13 +90,13 @@ This hook is invoked by 'git-commit' right after preparing the default log message, and before the editor is started. It takes one to three parameters. The first is the name of the file -that the commit log message. The second is the source of the commit -message, and can be: `message` (if a `\-m` or `\-F` option was -given); `template` (if a `\-t` option was given or the +that contains the commit log message. The second is the source of the commit +message, and can be: `message` (if a `-m` or `-F` option was +given); `template` (if a `-t` option was given or the configuration option `commit.template` is set); `merge` (if the commit is a merge or a `.git/MERGE_MSG` file exists); `squash` (if a `.git/SQUASH_MSG` file exists); or `commit`, followed by -a commit SHA1 (if a `\-c`, `\-C` or `\--amend` option was given). +a commit SHA1 (if a `-c`, `-C` or `\--amend` option was given). If the exit status is non-zero, 'git-commit' will abort. @@ -130,6 +134,13 @@ parameter, and is invoked after a commit is made. This hook is meant primarily for notification, and cannot affect the outcome of 'git-commit'. +pre-rebase +---------- + +This hook is called by 'git-rebase' and can be used to prevent a branch +from getting rebased. + + post-checkout -----------