From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.144 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796517538; b=CFaLABD2GFrmf4dwplrj5t/WxDOImR7sJpOdbslFTVukeC791rNyscdp/n152t6gySd3 8uDMHa0mshosONAzdKtnzogomdc/mUv971k8ypfyg1obZUpD753Z4QgAwNilxTQUYT31J zpeRu6vnP2BBAQKu2vStqeU/RDNc1OpzIO5du/EAyiQGqOHRpvYbY/gGv9f+YmBmE0FqA 5hG8TCdbfUhfZuHXx9GLclmBm8TM6VlISs/7RSO9oS67TVAAqCZcG2JwcprhInznrJpQr Gmv56dYANwcoHGlnC+k3JwDQcc+R6LKxK7HLTrxD+YU8Zzbw7MHIfCgFpAO7p8TK39w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796517538; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: User-Agent:MIME-Version:Content-Type; bh=m1qvYQnrOS+18VwqY9Z7sHhW7sMRsSRd4ZJ/t5iR/UM=; b=fDe0+Y74x8T83L7HVKYJ+cT/0alv/HWMRv1pIUO4GTry9bZ4d9JQekApNCSh/Ikk39cZ xUusIC9Zu1ZobBodRdgjqRPCEU06aLJWsG3v2xkpKmQlmFdvuzky8ASUITklRjoRJSK/R eUk9XkaV4YXbH+Y2wIF8kCCYwszh7huAjqTaaBTdlh8Ehz9mtdYdtl4Bw6TJLvfkNMW5j d5uad12rG2DiFVzGjWzMPuUDDAS1J7U1zjh4xZK2iU+Rry8EZPV47j7TT3U9ZGqVltrR/ SRvXIlDDStv9R89buMcWVhCpVaR0UYFRvZhhtrVpKto652tTXhPxEJlN3evE9q3I1+w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm3 header.b=WJ1hlyXd; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=0uyhmZRj; arc=none smtp.remote-ip=202.12.124.144 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2700F606A31F for ; Sun, 6 Dec 2026 00:38:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2700F606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm3 header.b=WJ1hlyXd; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=0uyhmZRj Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 7BB031D00109 for ; Sat, 5 Dec 2026 19:38:57 -0500 (EST) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-03.internal (MEProxy); Sat, 05 Dec 2026 19:38:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; 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=fm3; t=1796517537; x=1796603937; bh=m1qvYQnrOS +18VwqY9Z7sHhW7sMRsSRd4ZJ/t5iR/UM=; b=WJ1hlyXdG1L+gIR3zYCnDZC7iN 9Dks6n13yZc8mwT22BX598ekfYYos1ZzD4FwGGqgOMOMDxdg6+Hy7PuYKFnv1h73 /Zg3Z1wOlOo6pgOkisSw1cmuXix+XnutP8hTxOOPRwbVthHebBAga+zHXuPcTNwm 2Ry2eimc8LMe7RdnhW+/T0O1WoXvGtbEdDeXuQ1HTaVWX6rmMxluBTXISDkhbu+w yokGeutYy7HX4XMKOJHK2UX+baTEQWchbWoIZ+TX6z0udyEWB0JYbBb6Gg0UqXfM Dbmnntm4JPWfwEgf++NJt8NHTQmt4R+bztD4JdED+fTWI7VTzw4E+wpzjTCg== 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=fm1; t= 1796517537; x=1796603937; bh=m1qvYQnrOS+18VwqY9Z7sHhW7sMRsSRd4ZJ /t5iR/UM=; b=0uyhmZRjAHW+MVIWge2c1SsqrzJpRoUMEzGXf3goNfYJ5mLjzwt 6V/KN/zgakYAbGBS7xv9UMpMluYlZ+qwUEFOCJkICW8UmzX/jnGh48JEpw732LAN 0HaL6C4PC/5+rlgKby0sZGagMdPGzVUFY3DO1qnRlUXqrYnMjxroijwCUv/wRK/6 I+iXDygbZ7nBdVVUxnRdQFlMxnbjnYLY9qcDjXKcL3mJ+Jmv5B8aZ1a8X9SRI7WB ekhxNMr50OX11H4BuXFebP6+IZshoyPokr50KbtB7Ot3CS0gSaN/nXBFhC/zNch7 dpmTKXfe820fdGPr/x29J0EgU+Q1/AStlhQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pobox.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796517537; d=pobox.com; mf=PGdpdHN0ZXJAcG9ib3guY29tPg==; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:d+FMFB6J0bP61FpVQCDuAnVyFoba7vIL6ELllVOr+jFHpPy PGSSW+Z8TsQIUUrlWrLbR9QtzfsCkklcwlMTe9r/aQHerVseBdcQkoo6Me5niHFl 3xkPdmCGgUMvmMUnGha5bNvvs0Q9CF5u2CFE9C3EOMPMMvcMsnszBPQbjIWGJjR0 hXSCPzLC0BRt5EwXiizr/gudjf5oYDa/FWKcIYT+i9AcI8EIVh4wGcwAKDWMG/Tk Z4HJNo6Iyg8EHX/p/prPQpOdUanBUp3t70Th7LTLowmMlS7WGbc/+9S3pcQm8B6/ JhJatRT1dFPPjYvpmgSCHoAshE/3lIVEFuOLm/g==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to,user-agent; Message-Instance: m=1; h=sha256:N1wAz6zXt4aIHv8vOHTY8YmAa2TPz6JsTOLKLzPh/zE=:AKxB7LPBu8/S4e3PNCytm3veEczhkDoKQNQljzpkSks=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGXhvnPBDwzbEuOTDF9Bs31pc/jAt99gwsFoHJXzJ3qZlC8ZKQZTBS25Icn3UzbAV LdmM4GzXQa9UBif4374Q3Dde8b6E+Ag42wun4sL6WWQcpCVvMfuNRsC+PA7ycd35r/efoE q1q1PBFxrFr9VovqEcQNQkvc6S9PZh2TLdNXjCXIPIAEGfPnIivm/LpZAgs6L0q+HSttHG bThJN+BLGZsejaNgUuA3QTzSuSZwarVmKCZIzOeLhF8P9nFvKJ29+OTtRxE70oWFRTI2b+ uGHErBcicWOkQl58BzuVF2ZXpHBpLhmiubii8vxXD6whxCZ5Pdwx/g7GOM2xMn53XobxSv LZ1oYW8o99QAbJsHERF9FBfwEOoOWiHgxdoDmg8xJ13B5aNBmS1W7dCo/RZp4nTeC9nHCP fQsoLC2MB5MO61Zsunscsgs8n1TnFCepsp4YglN9BzB+w2YDprqf1nfOLc7e2wTqRIuWKI rsfpRExkyOnaOYeyK5BYltxM8+fFbGJ+cmJBHZsFQNMKvTnhugKBysGNXwc4VPdYSpUPXt KHYUsmNd/AlZ4C1/hHLMU7G/FxklFQscadxaTZwRQ+zgC0ZNSJA2kzvJZUu6t5I+aaq9Uh zX1OrfPQivhiB8vw153sN75i/PNMYrv5A9sxch2QqwVtcoOBhtWrqAW5+jeQ X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Dec 2026 19:38:56 -0500 (EST) From: Junio C Hamano To: Adrian Ratiu Cc: git@vger.kernel.org, Patrick Steinhardt , "Eric W . Biederman" , "brian m . carlson" Subject: Re: [PATCH v3 1/4] setup: reject compatObjectFormat == objectFormat In-Reply-To: (Adrian Ratiu's message of "Mon, 30 Nov 2026 15:43:22 +0200") References: Date: Sun, 06 Dec 2026 09:38:55 +0900 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain Adrian Ratiu writes: > When extensions.compatObjectFormat sets the same hash as the repo > object format, every command in a build with Rust aborts with: > > BUG: repository.c:204: hash_algo and compat_hash_algo match > > This includes "git config", so the bad value can't be removed with > Git. It also happens with no extensions.objectFormat at all, when > compatObjectFormat is set to the default object format. Running "git config" inside such a repository triggers gentle setup via setup_git_directory_gently() and read_and_verify_repository_format(). Because verify_repository_format() previously accepted matching values, setup proceeded into apply_repository_format() and crashed in repo_set_compat_hash_algo() before "git config" could even treat the repository as unusable. > diff --git a/setup.c b/setup.c > index 186815c780..a97280cafe 100644 > --- a/setup.c > +++ b/setup.c > @@ -918,6 +918,13 @@ int verify_repository_format(const struct repository_format *format, > return -1; > } > > + if (format->compat_hash_algo == format->hash_algo) { > + strbuf_addf(err, _("'%s' is '%s', the same as the object format"), > + "extensions.compatObjectFormat", > + hash_algos[format->hash_algo].name); > + return -1; > + } > + > return 0; > } Putting this check in verify_repository_format() relies on two invariants from read_repository_format() and handle_extension(). - '.hash_algo' is initialized to GIT_HASH_SHA1_LEGACY and never set to GIT_HASH_UNKNOWN, so an unset '.compat_hash_algo' (0) cannot spuriously equal '.hash_algo'. - checking after the full config is parsed catches the mismatch regardless of whether extensions.compatObjectFormat appears before or after extensions.objectFormat (or without extensions.objectFormat at all). Returning -1 here also makes gentle setup warn and fall back to non-git mode instead of aborting, so commands like "git config unset --file=..." can recover the repository, and non-Rust builds would report the same error.