From: Patrick Steinhardt Date: Thu, 03 Sep 2026 10:03:39 GMT Subject: Re: [PATCH v6 3/4] receive-pack: move message generation to separate function Message-ID: In-Reply-To: <20260903-758-introduce-hook-v6-3-6283b1fb9b1c@gmail.com> On Thu, Sep 03, 2026 at 11:28:00AM +0200, Karthik Nayak wrote: > diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c > index a9a3d21c24..9ac10465ac 100644 > --- a/builtin/receive-pack.c > +++ b/builtin/receive-pack.c > @@ -2535,67 +2535,72 @@ static void update_shallow_info(struct command *commands, [snip] > +static void report(struct command *commands, const char *unpack_status) > +{ > + struct strbuf buf = STRBUF_INIT; > + > + generate_report(&buf, commands, unpack_status, REPORT_STATUS_V0); > + > + if (use_sideband) > + send_sideband(1, 1, buf.buf, buf.len, use_sideband); > + else > + write_or_die(1, buf.buf, buf.len); > + strbuf_release(&buf); > +} > + > +static void report_v2(struct command *commands, const char *unpack_status) > +{ > + struct strbuf buf = STRBUF_INIT; > + > + generate_report(&buf, commands, unpack_status, REPORT_STATUS_V2); > > if (use_sideband) > send_sideband(1, 1, buf.buf, buf.len, use_sideband); A bit hard to see, but aren't these two functions now exactly the same except for the enum passed to `generate_report()`? Patrick