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

Re: [PATCH 1/1] builtin/receive-pack: avoid spinning no-op sideband async threads

From
Adrian Ratiu <adrian.ratiu@collabora.com>
Date
Mar 3, 2026, 12:45 UTC
Message-ID
<875x7dozdd.fsf@gentoo.mail-host-address-is-not-set>
In-Reply-To
<aaZ7eXtUSWSS_igX@pks.im>
On Tue, 03 Mar 2026, Patrick Steinhardt <ps@pks.im> wrote:
Show 11 quoted lines
> On Mon, Mar 02, 2026 at 09:17:04PM +0200, Adrian Ratiu wrote:
>> Exit early if the hooks do not exist, to avoid spinning up/down
>> sideband async threads which no-op.
>> 
>> It is important to call the hook_exists() API provided by hook.[ch]
>> because it covers both config-defined hooks and the "traditional"
>> hooks from the hookdir. find_hook() only covers the hookdir hooks.
>
> Just out of curiosity: will `find_hook()` eventually be removed? I saw
> that we still use it for the "proc-receive" hook in git-receive-pack(1)
> for example, which feels a bit fishy to me.

The answer is a big YES and I actually thought about this while fixing the regression yesterday (unrelated to proc-receive).

All hooks should use the new hook.[ch] APIs which provide clearer functions like hook_exists() and all direct find_hook() / run-command invocations should be removed.

> In any case, if this is an oversight then this can be handled in a
> subsequent patch series, if you ask me.

Yes, this can be done incrementally in a subsequent patch so that proc-receive can also benefit from hook.[ch] features like being able to specify it via configs.

It was out of scope for the initial patches, so I didn't pay too much attention to it, but it should be rather simple to convert. I do plan to convert it as well.

The end goal is to make find_hook() static (not exported outside hook.c) once all its external uses have been converted.

Previous: Patrick SteinhardtNext: Jeff King
Message 6 of 7 in “Fix update hook perf regression in next”
  1. 0/1 Fix update hook perf regression in nextAdrian Ratiu, Mar 2, 2026
  2. 1/1 builtin/receive-pack: avoid spinning no-op sideband async threadsAdrian Ratiu, Mar 2, 2026
  3. Junio C HamanoMar 2, 2026
  4. Adrian RatiuMar 3, 2026
  5. Patrick SteinhardtMar 3, 2026
  6. Adrian RatiuMar 3, 2026
  7. Jeff KingMar 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.