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

Re: receive.denyCurrentBranch=updateInstead won't update the repo

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2023, 22:28 UTC
Message-ID
<xmqqa5vsg8gp.fsf@gitster.g>
In-Reply-To
<CAGE71k3tMOtyFVrmGW33RuQ3GufJg8X6ORKCwHQgg6RmXbRCQA@mail.gmail.com>
"Adam \"Sinus\" Skawiński"  <adam.skawinski@sinpi.net> writes:
Show 7 quoted lines
> Correct me if I'm wrong, but I'm looking at receive-pack.c and can't
> grasp one thing.
>
> In receive-pack.c:1452-1453,
>> if (!invoked_hook)
>>   retval = push_to_deploy(sha1, &env, worktree->path);
> ... push_to_deploy is reached only if... hook didn't get invoked?

Correct. The hook is responsible for both DECIDING if it wants to touch/update the working tree, AND ACTUALLY UPDATING the working tree itself.

And the entire point of the "hook" is that its update does not have to be just "checkout the given commit's tree", for which using the default push-to-deply is sufficient. It is for those who want to do more.

Previous: Adam Sinus SkawińskiNext: Adam Sinus Skawiński
Message 6 of 9 in “receive.denyCurrentBranch=updateInstead won't update the repo”
  1. Adam Sinus SkawińskiJul 17, 2023
  2. Junio C HamanoJul 17, 2023
  3. Junio C HamanoJul 17, 2023
  4. Adam Sinus SkawińskiJul 17, 2023
  5. Adam Sinus SkawińskiJul 18, 2023
  6. Junio C HamanoJul 18, 2023
  7. Adam Sinus SkawińskiJul 18, 2023
  8. Junio C HamanoJul 18, 2023
  9. Adam Sinus SkawińskiJul 18, 2023

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.