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

Re: git hook question

From
Ben Knoble <ben.knoble@gmail.com>
Date
May 29, 2026, 17:52 UTC
Message-ID
<710DE79D-35C3-441B-9D7B-CE90798FA0C2@gmail.com>
In-Reply-To
<c5527d8c-9147-4355-a07d-153d3977108e@opperschaap.net>
Show 18 quoted lines
> Le 29 mai 2026 à 12:17, Wesley Schwengle <wesleys@opperschaap.net> a écrit :
> 
> On 5/29/26 01:21, Jeff King wrote:
>>> On Fri, May 29, 2026 at 01:01:34AM -0400, Wesley Schwengle wrote:
>>> I understand the why, normally pre-push gets `<local-ref> SP
>>> <local-object-name> SP <remote-ref> SP <remote-object-name> LF'. This has a
>>> similar feel, albeit a different syntax. The difference feels like a minor
>>> bug, but not one I'm worried about at this moment: you would expect it to
>>> get the same arguments/parameters as the regular pre-push hook. But I
>>> digress.
>> I think the "git hook" command is mostly intended for scripting, and the
>> caller is expected to understand the context and provide the appropriate
>> arguments. The hook command itself doesn't know about what a "pre-push"
>> hook should look like.
>> So not a bug, but definitely a gotcha that could perhaps be better
>> explained in the documentation.
> 
> I think the "normal" pre-push makes more sense than the one I'm seeing right now, but perhaps that's me. But I think that the docs would perhaps need an update to why this `remote url' are the arguments. Especially if you read `githooks(5)' it seems a little strange.
The hooks manual says that the pre-push hook is invoked with 2 parameters (name and location of the destination). 
Previous: WesleyNext: Jeff King
Message 5 of 10 in “git hook question”
  1. Wesley SchwengleMay 29, 2026
  2. Jeff KingMay 29, 2026
  3. Wesley SchwengleMay 29, 2026
  4. WesleyMay 29, 2026
  5. Ben KnobleMay 29, 2026
  6. Jeff KingMay 29, 2026
  7. Junio C HamanoJun 1, 2026
  8. Jeff KingJun 1, 2026
  9. Jeff KingMay 29, 2026
  10. Adrian RatiuJun 3, 2026

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.