From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 C9FF936E48D for ; Fri, 17 Jul 2026 06:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784268150; cv=none; b=pikPmWutTQeZH3ord/sdgbidjDfR6FEU7DBh8YFPJySa9Mc0XbMZWwLbbZ/ZElrKKTm7cKLZRmlEyGrq4fYI/8zHkTCjFmzVqELO5e/9nyAa3JDwkgYf7Tu9jwHB1tuO8r5Bp3gWiVxeBrgLVAS6nyK9hmjVSZzTCb8aJwfBhgs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784268150; c=relaxed/simple; bh=4je0w5EVH9Geflylv6Hpln2kPXCe/3YhqY40HXDzgtY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g2RHYgZtCuAaKSiAb5/ViQC37J/e9ohYl9EpCP67hh+HWtvMNTnvvpz8Z8sbz+3+b6GPmTEUpizHCv5sB4A7GTpkQf/Lc8i57cjFLMDKU3gbxfV/x3jtqyrIE3Zs0ilF1eA0WrMRmLD1WgvCbdjCbWfFE0JbhgTvy8yLILqDky8= 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=RdLaiGOx; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=UHCeaGxm; arc=none smtp.client-ip=202.12.124.158 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="RdLaiGOx"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="UHCeaGxm" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 19D557A011F; Fri, 17 Jul 2026 02:02:24 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Fri, 17 Jul 2026 02:02:24 -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=fm2; t=1784268143; x=1784354543; bh=6Br7tHJZtA 1cO7VqC2HRkuV2t9c+ZJr8QmMW1Ci5dzc=; b=RdLaiGOxsvQV95ODiVa0MfHLCW 6ssFAxHHzDoIONAmnvl5pqIxFFDgNIZ63JjR6VQlOchRzss1N5cBpkP+5JUzMgeF 1571cUxHWl/r+lrgjPtyhObJFNXtBzoeOJTEauHfcpQyeKV98xg5aWQRP9yIR726 AdPAMbr2tzaulA5mb8zX4RBAdimv3bqJfBTeWV+u1+cCVQPEODt5BIhk/7bXjAE0 1UznVuaxY8flp+QEOOQ4dvQ7i3bJCdNBmbjz4Si+hoLEx7EGAWPCrgYVNTU22EqN g+7Ywz3VKCI/6zZ8pABLZ0b/mYFGhoLmjX4EBy0Tp3p3vOxJyodj0dJGCQRQ== 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=fm2; t= 1784268143; x=1784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wWZhV hQt9SuCUKI8SLJ/xJ4ijQ6CvBZjMbJO4UH/aYTQYf8owaM4P07V30e3d6HwQ X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Jul 2026 02:02:23 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id 451fd001 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 17 Jul 2026 06:02:20 +0000 (UTC) Date: Fri, 17 Jul 2026 08:02:13 +0200 From: Patrick Steinhardt To: Junio C Hamano Cc: git@vger.kernel.org Subject: Re: [PATCH 3/3] refspec: stop depending on `the_repository` Message-ID: References: <20260716-pks-refspec-wo-the-repository-v1-0-aa40844d067f@pks.im> <20260716-pks-refspec-wo-the-repository-v1-3-aa40844d067f@pks.im> 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 Thu, Jul 16, 2026 at 01:59:59PM -0700, Junio C Hamano wrote: > Patrick Steinhardt writes: > > > The only remaining user of `the_hash_algo` in "refspec.c" is > > `refspec_append()`, which needs to know the hash algorithm so that it > > can parse the appended refspec item. In contrast to the functions > > adapted in the preceding commit, this function always operates on a > > `struct refspec`. As that structure is expected to only ever contain > > refspecs that all use the same hash function it doesn't make sense > > though to adapt each caller. > > > > Instead, adapt the structure itself so that it gets initialized with a > > hash function and use that hash function to parse new refspec items. > > Adapt callers accordingly. > > > > This removes the final dependency on the global repository variable in > > "refspec.c", so we can drop `USE_THE_REPOSITORY_VARIABLE`. > > While we lost some references to the_repository, we gained > more references to the_hash_algo in exchange. Because > the_hash_algo is defined in terms of the_repository->hash_algo, > it is only available when the_repository is still in use. > So these changes do not really help callers, and only leave > more for them to clean up later. > > Which is probably fine. We have to start somewhere, and > refspec parsing is a fairly well-isolated corner of the > universe that serves as a good starting point. Yup, this patch series follows our typical approach of making one subsystem `the_repository`-clean, but bumping that dependency up into the next-higher level. I've got a bunch of follow-up patch series that'll also convert some of those higher-up dependencies. Most importantly, I'm converting all subsystems that relate to the transport layer, as I'm on a very naive quest to try and get git-clone(1) working without `the_repository`. Let's see how far I get. Patrick