From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 56A531F9FE for ; Fri, 26 Feb 2021 06:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbhBZGEZ (ORCPT ); Fri, 26 Feb 2021 01:04:25 -0500 Received: from cloud.peff.net ([104.130.231.41]:45508 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhBZGEY (ORCPT ); Fri, 26 Feb 2021 01:04:24 -0500 Received: (qmail 11847 invoked by uid 109); 26 Feb 2021 06:03:44 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 26 Feb 2021 06:03:44 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 16341 invoked by uid 111); 26 Feb 2021 06:03:43 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 26 Feb 2021 01:03:43 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 26 Feb 2021 01:03:43 -0500 From: Jeff King To: Patrick Steinhardt Cc: git@vger.kernel.org, Yaron Wittenstein , Junio C Hamano Subject: Re: [PATCH] githooks.txt: Clarify documentation on reference-transaction hook Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Feb 25, 2021 at 06:50:12AM +0100, Patrick Steinhardt wrote: > The reference-transaction hook doesn't clearly document its scope and > what values it receives as input. Document it to make it less surprising > and clearly delimit its (current) scope. > > Signed-off-by: Patrick Steinhardt > --- > > I've been postponing doing this simple doc update for far too long, but > here it finally is. It simply clarifies its current workings and > limitations without changing anything. This is not supposed to be a "We > don't want it to ever cover symrefs", but rather to avoid confusion. I think that's a good step forward. We might want to say "does not cover symbolic references (but that may change in the future)" to make it clear that nothing is definite. OTOH, I suspect adding them would require a change to the hook's stdin format, so it is not like a hook could be written in a way to magically handle them if things change in the future. > @@ -492,6 +493,13 @@ receives on standard input a line of the format: > > SP SP LF > > +where `` is the old object name passed into the reference > +transaction, `` is the new object name to be stored in the > +ref and `` is the full name of the ref. When force updating > +the reference regardless of its current value or when the reference is > +to be created anew, `` is 40 `0`. To distinguish these cases, > +you can inspect the current value of `` via `git rev-parse`. We should probably avoid saying "40" here. Maybe "all zeroes" or something. -Peff