From: Patrick Steinhardt Date: Thu, 03 Sep 2026 10:03:33 GMT Subject: Re: [PATCH v6 2/4] receive-pack: drop static variables to track report status version Message-ID: In-Reply-To: <20260903-758-introduce-hook-v6-2-6283b1fb9b1c@gmail.com> On Thu, Sep 03, 2026 at 11:27:59AM +0200, Karthik Nayak wrote: > diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c > index 86933d8d7e..a9a3d21c24 100644 > --- a/builtin/receive-pack.c > +++ b/builtin/receive-pack.c > @@ -2716,10 +2722,12 @@ int cmd_receive_pack(int argc, > &push_options); > delete_tempfile(&pack_lockfile); > sigchain_push(SIGPIPE, SIG_IGN); > - if (report_status_v2) > + if (version == REPORT_STATUS_V2) > report_v2(commands, unpack_status); > - else if (report_status) > + else if (version == REPORT_STATUS_V0) > report(commands, unpack_status); > + else > + BUG("unknown report status version"); Nit: I typically prefer switches when we want to handle enums, even though they are more verbose. Please feel free to ignore though, this is highly subjective and it's not worth a reroll. Patrick