Subject: Re: [TOPIC 2/17] Hooks in the future

From: Junio C Hamano <[email-masked]>
Date: Tue, 07 Apr 2020 17:40:14 -0700

Emily Shaffer <[email-masked]> writes:

> [hook "unique-name"]
>   pre-commit = ~/path-to-hook.sh args-for-precommit
>   pre-push = ~/path-to-hook.sh
>   order = 001
>
> Then, in another config:
>
> hook.unique-name.pre-push-order = 123
>
> or,
>
> hook.unique-name.enable = false
> hook.unique-name.pre-commit-enable = true
>
> To pick it apart a little more:
>
>  - Let's give each logical action a unique name, e.g. "git-secrets".
>  - Users can sign up for a certain event by providing the command to
>    run, e.g. `hook.git-secrets.pre-commit = git-secrets pre-commit`.
>  - Users can set up defaults for the logical action, e.g.
>    `hook.git-secrets.before = gerrit` (where "gerrit" is the unique name
>    for another logical action), and then change it on a per-hook basis
>    e.g. `hook.git-secrets.pre-commit-before = clang-tidy`

Sorry, but the description and the tokens used in there are so
detached from the current reality that I am having a hard time
trying to even guess what you two were talking about.  

For example, how would I express that I am using program X as my
'push-to-checkout' hook in a way consistent with the above
description?  Would "push" correspond to your "git-secrets" and
"checkout" to your "pre-commit", or would these be placed where you
wrote "unique-name"?