From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (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 B0FE5430CF9 for ; Mon, 31 Aug 2026 13:30:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788183054; cv=none; b=ZMQo18NKxorBV6nVyLzTtC0eL934Hn2rwrh2rR8ILYhREAX9qQKrdoqxRJszUHsThycLCQJ4jbRsxtZcVyoPyrRZs+v3H3IBMCwnfc/2JODOqRmtSsQTC9V4wjf/TAIiMTxzpAxDYnGAR1upYSFP6oqRgpqaWQNLcqrLcK2Bbf4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788183054; c=relaxed/simple; bh=pTCIiWejL0lEqQ0q1KF2s3uRyd82gw1gIdeg6/ygA44=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uMYlXBEqeWfXbgo05E28rkyivNNL1xTDk6nafic/PFCwRAOx8kfXGraVJH7mqZ3+HKMzyxVrqUbrqTLivik7rOba1bhhqOZYam9ztvzWkVAy+kc/o0VKcOWOzFrUqh2nJ0foqTwI16vkLhOR/vRgZoxzKbudpNca8ZSzzo7Guy0= 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=Oy1DjChZ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NrgkueM4; arc=none smtp.client-ip=103.168.172.157 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="Oy1DjChZ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NrgkueM4" Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id EE1FF140011B; Mon, 31 Aug 2026 09:30:48 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 31 Aug 2026 09:30:48 -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=fm3; t=1788183048; x=1788269448; bh=0cdUmEGKmX cq+7TgRX+lgW4SsEZ92lmO2Ryz+c5ioWM=; b=Oy1DjChZLGDNz7UBgYR01p9wBB gxEiuJoT1olrG73c/P9mQN3AI/0mNzzU1Tvd9IPvlrBOAVdlg4ZshrXJXo4lenUR NuspB/95JOucjfxtqfI8hC+im8IcCnfvZRPfyH/pinr4PcZvhSwQdAXN9hJjHdzZ SLitxJlvf0d0wgF9ADyrmsAK4KDpMWXZi6DtKE4zOyNNs6jKUn1f+POwVhRa/zg6 ZLgEd5LIUVqqv51baVWMFb+CBIUjseFfIpR/OiZdKgIyG/Bru11tRHfzbLqkfhXv Ws60sU6sKNC4p+K+yAntqbA+eUwMkPGIbm5nZANsxgyyRGL4CRfsdLbFXzkw== 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=fm3; t= 1788183048; x=1788269448; bh=0cdUmEGK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8TZnqBC7hYek49FtL85+aK5CzSRzQ X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Aug 2026 09:30:47 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id c122dc86 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 31 Aug 2026 13:30:56 +0000 (UTC) Date: Mon, 31 Aug 2026 15:30:36 +0200 From: Patrick Steinhardt To: Junio C Hamano Cc: Derrick Stolee via GitGitGadget , git@vger.kernel.org, Taylor Blau , Derrick Stolee Subject: Re: [PATCH v2 1/7] banned-die: create header for banning of functions Message-ID: References: <84634717e2eca479026d1cdf39a089a8f61d131e.1787684181.git.gitgitgadget@gmail.com> 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 Tue, Aug 25, 2026 at 01:34:53PM -0700, Junio C Hamano wrote: > "Derrick Stolee via GitGitGadget" writes: > > > From: Derrick Stolee > > > > We have universally-banned functions listed in banned.h since > > c8af66ab8ad (automatically ban strcpy(), 2018-07-26), but some layers of > > the code should be more strict than others. > > > > One such example is the trace2 API which runs during atexit() and can > > prove to cause die()-handler recursion problems if it calls die(). > > > > Create a new banned-die.h header file that will ban some Git methods > > that call die(). Include that in all trace2 API implementation files. > > This currently only bans die() itself, and that was already not used. > > > > It would be reasonable to name this file trace2/tr2_banned.h to be > > specific to the trace2 API, but it seems like such a restriction would > > be valuable to put in some other areas of the code, so adding it at the > > root of the tree seems like a good long-term approach. > > In other words, the functions banned by including this file are not > listed because they are banned from being used in trace2 API, but > because they may lead to die(). There may be some other traits that > we might want to avoid in certain subset of our code, and we may > have similar banned-frotz.h header to prevent direct or indirect use > of frotz. Which makes sense to me. > > Would the same approach work for the_hash_algo and the_repository, I > wonder? Don't we already do this? If `USE_THE_REPOSITORY_VARIABLE` is not defined then we hide several function declarations where we know that they depend on `the_repository`. It's not perfect as we still expose functions that do rely on it implicitly, but it's easy to remove more function declarations over time by just adding another ifdef. Maybe we should follow a similar approach with functions that die? Patrick