From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) (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 206DA38C2BF for ; Fri, 10 Jul 2026 05:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783663022; cv=none; b=Y8ty9PJMB55sFP9Rj57X4P3D0H9TCNRTg19l89MdAHLvhXe8uEP2HRdDoCGl+8HQeZJS+Jk7aqCyi47w5IP4ofbNrGzYw1Yyiq/dKMrHHGjomMGaHYMYa5Ix4XFywkiThuXeeUds/6e8Axmh4h+3vEIqfM0xWoZ3PNAPYoc/eyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783663022; c=relaxed/simple; bh=CkUV3pgBWdijWLkc7gLBVGBRZfg03TLHKsXJUyEjW20=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HwkO/L3Qold9NO8/Zpck5BZJA+pTTY4ZTMWx96tTwhyBetvydlCYXX7d3ms8GTAg5mStyJO93yLHLZdlaSCURkC/5v/8kImdZKRYrpTAX6v+k1S1IXQD9GvrlJL3Et+UP7uuv70a5/rTJibn9GqF/PdsaIUNMsP535KSQIrcTgs= 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=WgdOU4sc; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=qjHGFp2d; arc=none smtp.client-ip=202.12.124.159 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="WgdOU4sc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="qjHGFp2d" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 50CF87A0077; Fri, 10 Jul 2026 01:57:00 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Fri, 10 Jul 2026 01:57:00 -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=1783663020; x=1783749420; bh=Woffgfo/NB Gx/yic/e0ljsLenXtovdiN5X0iqoL8U7s=; b=WgdOU4scH4yaGlgkAil20GGdfm qvxKHOMCZkAoO5wP2zO8t3oIbJBWhcKCGhBa4OhqrrMDxEKoQQdJxDj1g4UpTCr0 f6iM+kf+RIzGLrd0XsHmWKeelMREl9nhhnl5+hojicY2WPn5SumcUxn3K7qb3OC9 Md+cK6HtRMK/rHKGCub37DmUxHQag0A5RS5H0itPO1yo2fHJVz3fQ6pv7yLNVP6Q jW8L+Aj4cYkN7st8wEnlAOxY/wMWI84Qu8tgCFGJHNGJfrOCGcrHv8yhzlQbBFn/ a3eD1Ri17H/WaEHc7BAu0I2ZzXMYJBUqZjfMEVax+Sw23f1Uh6YdIz75DsLQ== 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= 1783663020; x=1783749420; bh=Woffg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d1z1mMo9DDqmgenQ X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Jul 2026 01:56:59 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id b4c7670c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 10 Jul 2026 05:56:58 +0000 (UTC) Date: Fri, 10 Jul 2026 07:56:55 +0200 From: Patrick Steinhardt To: Junio C Hamano Cc: git@vger.kernel.org Subject: Re: [PATCH 1/7] refs/packed: de-globalize handling of "core.packedRefsTimeout" Message-ID: References: <20260709-pks-refs-wo-the-repository-v1-0-1ad6f27529c9@pks.im> <20260709-pks-refs-wo-the-repository-v1-1-1ad6f27529c9@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 09, 2026 at 11:52:11AM -0700, Junio C Hamano wrote: > Patrick Steinhardt writes: > > > diff --git a/refs/packed-backend.c b/refs/packed-backend.c > > index 499cb55dfa..5c49c06493 100644 > > --- a/refs/packed-backend.c > > +++ b/refs/packed-backend.c > > @@ -162,6 +162,13 @@ struct packed_ref_store { > > * `packed_ref_store`) must not be freed. > > */ > > struct tempfile *tempfile; > > + > > + /* > > + * Timeout when taking the "packed-refs.lock" file. configurable via > > + * "core.packedRefsTimeout". > > + */ > > + bool timeout_configured; > > + int timeout_value; > > }; > > > > /* > > @@ -1233,12 +1240,10 @@ int packed_refs_lock(struct ref_store *ref_store, int flags, struct strbuf *err) > > struct packed_ref_store *refs = > > packed_downcast(ref_store, REF_STORE_WRITE | REF_STORE_MAIN, > > "packed_refs_lock"); > > - static int timeout_configured = 0; > > - static int timeout_value = 1000; > > > > - if (!timeout_configured) { > > - repo_config_get_int(the_repository, "core.packedrefstimeout", &timeout_value); > > - timeout_configured = 1; > > In the original code, when core.packedrefstimeout is not configured, > our call to repo_config_get_int() does not touch timeout_value. As > a result, we get the static 1000 and flip the "configured" flag to > prevent this _value from further getting updated. > > > + if (!refs->timeout_configured) { > > + repo_config_get_int(ref_store->repo, "core.packedrefstimeout", &refs->timeout_value); > > + refs->timeout_configured = true; > > But what happens in the new code when core.packedrefstimeout is not > configured? It is up to whoever initialised refs->timeout_value. > > If I am not mistaken, packed_ref_store_init() does xcalloc(), lets > base_ref_store_init() initialise some members, initialises a few > members itself (such as .store_flags and .path), and leaves other > members, including .timeout_configured and .timeout_value, > NUL-filled. .timeout_configured starting as false is perfectly > fine, but shouldn't we initialise .timeout_value to 1000 as before? Ugh, we should. That's what happens when you tack on a last-minute patch to a series you had sitting around for weeks. Thanks for noticing! Patrick