Re: [PATCH v2 7/7] docs: document multiple hooks
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 14, 2019, 13:38 UTC
- Message-ID
- <CACsJy8B-qn9Vqrm5xF4Eg0j+dfw=WqtnJK5-Jz4kDKvJTNv_tw@mail.gmail.com>
- In-Reply-To
- <20190514002332.121089-9-sandals@crustytoothpaste.net>
On Tue, May 14, 2019 at 7:24 AM brian m. carlson <sandals@crustytoothpaste.net> 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.
Show 11 quoted lines
> 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
-- Duy