From patchwork Thu Jun 6 05:28:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13687818 Received: from wfout6-smtp.messagingengine.com (wfout6-smtp.messagingengine.com [64.147.123.149]) (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 2B3B83B1BC for ; Thu, 6 Jun 2024 05:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717651744; cv=none; b=rGNSSIbG6Rk0yJ3NVMVlBODUIaubIM8jpq/b7kKSQ6jlvJmAU/c8Rg+Qor3SJ5MapTXwdPKoOqBAkNu+c44olQlyV3UE5iS8usd8SvGolNfEO4mLzH4Sfs91j2clTcfACR04F7QB96sS5WKJUx6Qo9h9z4hhAMbvxfW/X1EiNFQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717651744; c=relaxed/simple; bh=Nq/8gJa+Kq3l8OiehupsScLUIBTADIvm5y7xr37Drn0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gF0B2wXHTmFClEWa8tyWTmP06bU0O4yBfHStd01mg70K4Du8sWs3Cn6JsyS3XxqSEhNfLtZkbIgM86EfG9eHkN05IeJLqpmYxDvUOJaNQs/2F6+rGY1TtOc5enSY3TtuSRVmynyWXOa+qSNvIJfHWx6CUhjb+7jFT7HDNJUmvrA= 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=Ez8k9f4L; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MnBHEiv2; arc=none smtp.client-ip=64.147.123.149 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="Ez8k9f4L"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MnBHEiv2" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id EFB3D1C001D0; Thu, 6 Jun 2024 01:29:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 06 Jun 2024 01:29:02 -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=fm1; t=1717651741; x=1717738141; bh=qDOiKOuhcZ EX7/k455COCf87MTP6jZPoNKaStQCtCds=; b=Ez8k9f4LRJP+I8eU6djPaa7MCy huMpiueiaOecRNmmNTMI8NquCPzLJvskwLHJ7a80Qyz6pbShUikHPzY86a4S0P2D Sf7oIYdALzViCVUDcblQuzQJ/gO2sSNYFWzGRn34fg2nUCgcsxgFlQ/Iky3IbeoV zC6IHBtoCPKtxsN2BNOCkcdYxTbuO8MlwWsDDCLZJKcHh2rYy7ZR5e+f3jZ0OeUg zU47K0yCjaBmxXHNRwEwf6zDrRdsLytuf7vO+Edeq09b5TT3ak8RcPHUHEGEcqi/ xLkxiRvxnRJum0V3APXuASXcyuU/yNLvbM8Ekkv68H2SKlgabne8oaPbbC8Q== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717651741; x=1717738141; bh=qDOiKOuhcZEX7/k455COCf87MTP6 jZPoNKaStQCtCds=; b=MnBHEiv2cFcp743V86u5k6fjHSsgzhTQ2xlVprvhMPvV Zg4h8AWqfjE7MnrXF2Kc/8cwkaZ0iVB/2tbiNCqb9JfCv5HbAJ+nGBejH50+xNG6 31nRQQE442Kxrw8B5UtpPPnI+4V3ndT8Rw0tPeuMmoyiNaRyE3CxcUBAas2nNzSL 0B2ZDMhhq7VriT4mQ+fgw0d+xYnzvjTDSedR9MvxXR0+te4bqzuwY4F5BYIT8UW0 2Fkv/+L3OEMisHghbEP3M0cLhsWNuOTTGIzc6qBUNEuurFhcpjvbiy6nYlWPj2Fq MCOLVbFw4m+5G62OlTmLU0iappa4Aq1gjBaT20kr3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeljedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Jun 2024 01:29:00 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id a5fca1da (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 6 Jun 2024 05:28:29 +0000 (UTC) Date: Thu, 6 Jun 2024 07:28:57 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Eric Sunshine , Junio C Hamano , Ramsay Jones , Justin Tobler , Karthik Nayak , Jeff King Subject: [PATCH v5 01/12] setup: unset ref storage when reinitializing repository version Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: When reinitializing a repository's version we may end up unsetting the hash algorithm when it matches the default hash algorithm. If we didn't do that then the previously configured value might remain intact. While the same issue exists for the ref storage extension, we don't do this here. This has been fine for most of the part because it is not supported to re-initialize a repository with a different ref storage format anyway. We're about to introduce a new command to migrate ref storages though, so this is about to become an issue there. Prepare for this and unset the ref storage format when reinitializing a repository with the "files" format. Signed-off-by: Patrick Steinhardt --- setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.c b/setup.c index 7975230ffb..8c84ec9d4b 100644 --- a/setup.c +++ b/setup.c @@ -2028,6 +2028,8 @@ void initialize_repository_version(int hash_algo, if (ref_storage_format != REF_STORAGE_FORMAT_FILES) git_config_set("extensions.refstorage", ref_storage_format_to_name(ref_storage_format)); + else if (reinit) + git_config_set_gently("extensions.refstorage", NULL); } static int is_reinit(void)