From patchwork Tue Dec 7 10:55:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 12661581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95786C433EF for ; Tue, 7 Dec 2021 10:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235461AbhLGLAI (ORCPT ); Tue, 7 Dec 2021 06:00:08 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:43525 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbhLGLAH (ORCPT ); Tue, 7 Dec 2021 06:00:07 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C9D1D5C019E; Tue, 7 Dec 2021 05:56:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 07 Dec 2021 05:56:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:mime-version:content-type; s=fm2; bh=oUvv5sp9xbPSD2LomKpBp3yti5blWCb4UOFY+yDQ8Vs=; b=NrUseoj/22P0 2R+hAtlYXno9+ZtWWtHaAXkxwxgwRhyRfFLkY+xxk9WgjWPEevJUa7KnLV+gVJM0 nxS0+RYJcAlhEVeg+X3gLxsWVwZRgptBLakGmC/Se6FaJF17/aHGwJtdrvgeys4W bwPfiFMTha7M2jg8hoVb66DF8JM0My/f3s16UbtQTiYJTp5sdaPcleesNBrSuszC tGNHh38EgmbmLbN7gvc+Kz1NRhkBR/XqwQEySWjyn3Q+rfz3Nbcb3G0n/A58eS++ Dl6aNfvJNHVPEtHJyxMN6FnJ3OT7cKiyBNeXDoT17O+KKRSlmJbw5y62Zgb+Afcd MGwj3hrejw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=oUvv5sp9xbPSD2LomKpBp3yti5blW Cb4UOFY+yDQ8Vs=; b=i+SjY53/ourS/DFUvP1tWzME1fp/MpniEXO1UHPrlMXrK d5d01YXJxqOKqH6G2FJYdoetxOVkCVdNtidZ835wyMJ12DV6mKSIkiS6vuEpKqkQ CHUTym4+rqgSSBSZX3pq783VZya/966B/A8VUVHUaAvGZW50v4jHxjRTTSXz+bb7 PKIg1v0EOkNFP6sjY6S272wKZqwPLXAzSOhhOjOiG0TQuRZ/dGQu7Wj+1ypjCMXd tC+oZhHyeuRKwzRyn6mwH/UcUk7mn3PYZNDIp1iCRonPS4mumGCOyvW0CTYXn1yB qm8G78vmBNcDT9/3wQuITgZqV3Yh807Xeb0IHHddw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjeehgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugesghdtreertddtvdenucfhrhhomheprfgrthhrihgtkhcu ufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepje eifedvueelfffgjeduffdvgefhiefgjefgvddvfeduvefffeevfffhgfekieffnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrd himh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Dec 2021 05:56:35 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 85ea01b0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 7 Dec 2021 12:26:10 +0000 (UTC) Date: Tue, 7 Dec 2021 11:55:52 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Jeff King , Bryan Turner , Waleed Khan Subject: [PATCH 0/6] refs: excessive hook execution with packed refs Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, as reported by Waleed in [1], the reference-transaction hook is being executed when packing refs. Given that the hook ideally ought to track logical updates to refs instead of leaking low-level implementation details of how the files backend works, this is understandably leading to some confusion. This patch series aims to fix that by improving how the tandom of loose and packed refs backends interact such that we skip executing the hook when the loose backend: - repacks references. - needs to delete packed refs when deleting a loose ref would uncover that packed ref. Patrick [1]: Patrick Steinhardt (6): refs: open-code deletion of packed refs refs: allow passing flags when beginning transactions refs: allow skipping the reference-transaction hook refs: demonstrate excessive execution of the reference-transaction hook refs: do not execute reference-transaction hook on packing refs refs: skip hooks when deleting uncovered packed refs refs.c | 11 +++++-- refs.h | 8 ++++- refs/files-backend.c | 25 +++++++++++----- refs/packed-backend.c | 30 ++++++++++++++----- refs/packed-backend.h | 6 ++++ refs/refs-internal.h | 1 + sequencer.c | 2 +- t/t1416-ref-transaction-hooks.sh | 50 ++++++++++++++++++++++++++++++++ 8 files changed, 113 insertions(+), 20 deletions(-)