Re: [PATCH 1/3] githooks.txt: Improve the intro section
From: Eric Sunshine <hidden>
Date: 2016-06-16 02:18:58
On Sun, Apr 24, 2016 at 4:20 PM, Ævar Arnfjörð Bjarmason [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Change the documentation so that: [...] Signed-off-by: Ævar Arnfjörð Bjarmason <redacted> ---diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt@@ -130,7 +130,11 @@ The template directory will be one of the following (in order): The default template directory includes some directory structure, suggested -"exclude patterns" (see linkgit:gitignore[5]), and sample hook files (see linkgit:githooks[5]). +"exclude patterns" (see linkgit:gitignore[5]), and example hook files. + +The example are all disabled by default. To enable a hook, rename it
s/example/examples/
quoted hunk ↗ jump to hunk
+by removing its `.sample` suffix. See linkgit:githooks[5] for more +info on hook execution.diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt@@ -13,18 +13,26 @@ $GIT_DIR/hooks/* +Hooks are programs you can place in the `$GIT_DIR/hooks` directory to +trigger action at certain points. Hooks that don't have the executable +bit set are ignored. + +When a hook is called in a non-bare repository the working directory +is guaranteed to be the root of the working tree, in a bare repository +the working directory will be the path to the repository. I.e. hooks +don't need to worry about the user's current working directory. + +Hooks can get their arguments via the environment, command-line +arguments, and stdin. See the documentation for each below hook for +details. + +When 'git init' is run it may depending on its configuration copy
s/may/&,/ s/configuration/&,/
+hooks to the new repository, see the the "TEMPLATE DIRECTORY" section +in linkgit:git-init[1] for details. When the rest of this document +refers to "default hooks" we're talking about the default template +shipped with Git. + +The currently supported hooks are described below.