From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B4C13911CE for ; Mon, 24 Aug 2026 05:32:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787549574; cv=none; b=bptU79cnTMSirOE4RTnjVvrSRVjPVVpr8YwD5yW2bCacgeUiAzoS0RQg09HmcmFmnKaMOCscqsh/h17sDCEUbRPkOAP8rawco55Un/0VOpDo2+IDTdbsY1AiaiaTmjWTJRfd5s1DZJ5BfguAUIadLwS8423tJFLUzrf82cmQyVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787549574; c=relaxed/simple; bh=oV4n+xlD8snUiF8i138ZcvGc547ZpuUFuHvbXgUJtWE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NnMnhDVh8o2zl+cLbH0/p7oQ3G6GtLsMkL4Tvs1KoHPpF/qMP1RYVOoO4uFhEgqRb/W/oF6rOF9VSFQcbRr//D74S3DNaOGz9e39wH9a081JIJ76zgrS+B+caXQCnD6j5fDiWxFkiC+G7VmqNB5aQK0jYUQ/QaSWVjmd/HAMSLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=lChcXCQV; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OamooDpT; arc=none smtp.client-ip=202.12.124.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="lChcXCQV"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OamooDpT" Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 77F061D00065; Mon, 24 Aug 2026 01:32:39 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 24 Aug 2026 01:32:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1787549559; x=1787635959; bh=vSYqB6yC2s VJR+S3G5OyCDX/0bKo7jsaZSNxHhJVchg=; b=lChcXCQVk2otxB2K3gdWldBrhp Og0DH10JLPBuqzp8tbOQOSLD2EKyclkBjxyaKMjLR7Yfm3OSiwYqoFHAHJDJsAY9 quRd/dveMi1mEVbZHA5rV5+MnwjYqY1Ej5wawB3WgjKiYP9V7VzAqeHF3FYs+Rv2 VQ4Psd50nvRhI4cBj/X0GExhkyq5EeLeunRmTpgYVDHSU+EqRqwZc6f57QVLpCkg k8lSV1WW6PvdHqXhGEGZe74kHC1Wrr4HOLDSrQCgS1q1mBTRVL/uzNhkR+itsMnz OzeTNir7HlueMOOHKk6nuDiD2vN7bh+LPIB4yPG1UhW0dRWokmJcBPS3Tfsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1787549559; x=1787635959; bh=vSYqB6yC2sVJR+S3G5OyC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WHqHigJ+Yp32PkERxAh2381Q X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Aug 2026 01:32:37 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id 2bb5f4e9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 24 Aug 2026 05:32:36 +0000 (UTC) Date: Mon, 24 Aug 2026 07:32:32 +0200 From: Patrick Steinhardt To: Karthik Nayak Cc: git@vger.kernel.org, gitster@pobox.com, kristofferhaugsbakk@fastmail.com, Phillip Wood Subject: Re: [PATCH v2] hook: introduce the report hook for git-receive-pack(1) Message-ID: References: <20260818-758-introduce-hook-v1-1-8a8d89e65838@gmail.com> <20260821-758-introduce-hook-v2-1-e90e2f7ac2cf@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Aug 21, 2026 at 09:08:12AM -0700, Karthik Nayak wrote: > Patrick Steinhardt writes: > > On Fri, Aug 21, 2026 at 03:34:58PM +0200, Karthik Nayak wrote: [snip] > >> +repository, but before the pkt-line encoded status report is sent back > >> +to the client. > >> + > >> +The hook receives the complete pkt-line encoded status report on > >> +standard input. The report begins with an `unpack` line indicating > >> +whether the object transfer succeeded (`unpack ok` or > >> +`unpack `), followed by one `ok ` or > >> +`ng ` line per ref that was pushed, and is > >> +terminated by a flush packet. > >> + > >> +The hook's standard output entirely replaces the report that is sent > >> +to the client. The hook must write a valid pkt-line encoded report in > >> +the same format it received. The hook's stdout is fully buffered by > >> +`receive-pack` before any data is sent to the client, so the hook's > >> +exit status is known before the client receives anything. > >> + > >> +There are two distinct ways the hook can affect the push outcome: > >> + > >> +* To reject individual ref updates while keeping `receive-pack` alive, > >> + rewrite the corresponding `ok ` lines to > >> + `ng ` lines in the output and exit with status 0. > > > > It's `ng [ ]`, right? I think the reason itself is > > optional. We might also want to clarify whether there should be a > > trailing newline or not. > > > > You're right, since 'send-pack' will default to 'failed' if there is no > reason. > > We do say 'terminated by a flush packed'. We only send the flush packet once donce with all refs though, right? I was wondering about each individual reference line: are they supposed to end with a newline or not? Patrick