Web lists-archives.com

Re: [PATCH v2 7/7] docs: document multiple hooks

On Tue, May 14, 2019 at 7:24 AM brian m. carlson
<sandals@xxxxxxxxxxxxxxxxxxxx> wrote:
> +It is possible to provide multiple hooks for a single function. If the
> +main hook file is absent,

If I remember 1/7 correctly, if the hook "file" is a directory, you
ignore it and check for hook.d too.

Which makes me think, can we just check if hooks/<hook> is a directory
and use it instead of hooks/<hook>.d? [1]

The only advantage of <hook>.d that I can see is if we support some
sort of combination of <hook> and <hook>.d.

[1] Of course if you're really strict on backward compatibility then
this is out of question.

> hooks are additionally looked for in a
> +directory with the name of the main hook file with a `.d` appended.
> +(That is, if `post-receive` is missing, `post-receive.d` is inspected
> +for any hooks that might be present.) Each of these hooks is executed in order,
> +sorted by file name. By default, if a hook fails, additional hooks are not
> +executed, but this can be controlled with the `hook.*.errorBehavior` setting
> +(see linkgit:git-config[1]).
> +
>  `git init` may copy hooks to the new repository, depending on its
>  configuration. See the "TEMPLATE DIRECTORY" section in
>  linkgit:git-init[1] for details. When the rest of this document refers