git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] hook: provide GIT_HOOK for all hooks

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 28, 2022, 15:53 UTC
Message-ID
<220528.86bkvh3b3q.gmgdl@evledraar.gmail.com>
In-Reply-To
<pull.1271.git.git.1653684771998.gitgitgadget@gmail.com>
On Fri, May 27 2022, John Cai via GitGitGadget wrote:
Show 5 quoted lines
> From: John Cai <johncai86@gmail.com>
>
> In order to allow users to use one executable for multiple hooks,
> provide a GIT_HOOK variable that is set to the hook event that triggered
> it.

You can use one executable for multiple hooks already, I've written such dispatchers that just look at the argv of the process.

What we will need something like this for is for the config-based hooks, and I think it makes sense to have a facility that's portable across both methods of hook invocations.

I really don't mind this change, and I think it's a good one to make.

But the commit message & documentation here really should be updated to reflect that this is currently superfluous to inspecting argv in the hook process, and that we're providing this anyway for XYZ reason.

Previous: John CaiNext: John Cai
Message 4 of 7 in “hook: provide GIT_HOOK for all hooks”
  1. hook: provide GIT_HOOK for all hooksJohn Cai via GitGitGadget, May 27, 2022
  2. Junio C HamanoMay 27, 2022
  3. John CaiMay 28, 2022
  4. Ævar Arnfjörð BjarmasonMay 28, 2022
  5. John CaiMay 28, 2022
  6. Junio C HamanoMay 28, 2022
  7. John CaiMay 31, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.