From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.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 99A77432BF7 for ; Mon, 10 Aug 2026 17:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786384499; cv=none; b=H4pVoASVsdMZqm1sSapggnQSgdxZdspseIAO07QHvwBdzEbrp1+0ND1QXo4XAgTMU90mGDLE0BCYjUz7TgYFzzsnV8bdOieV5meJNIom6U4mgZkpN06IZ2t5jBtNt41yO9TJqFXvwCOEVWymd9KGWzStOlLnQB8F4N8Q0p0tGGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786384499; c=relaxed/simple; bh=9hEW6mr8utGBz09Dcr2Qv1JUzT0SAH21tnQNIwZv4pM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=LZ7Gcmpo6jn+mvRz3lnuWBbggj76IaJuwFbMKU8dkDWA9j2NpBs+YQz9Nn7PmA+eruZB6PPuT7nP1a8rQ/M2wJChSfxM2lYkslGGe9Tl0vbdRH+4IDGocWU/gwkYvFYbyn9LHydnDIo2wPmdqGxeQUQPBQt9M9V57dp4wiJQksg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=jbedPSpc; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=apHGG74F; arc=none smtp.client-ip=202.12.124.149 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) header.d=pobox.com header.i=@pobox.com header.b="jbedPSpc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="apHGG74F" Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id D5ADB1D0022A; Mon, 10 Aug 2026 13:54:56 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-03.internal (MEProxy); Mon, 10 Aug 2026 13:54:56 -0400 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=fm2; t=1786384496; x=1786470896; bh=KriHSxPk1e mrXxSLT/SptcnTyZOsp095JJqnhuoQwks=; b=jbedPSpcilUgNfd8PiL//RvKgU oVYSUsLCEYgk0i3+3Ak4Gk4gKYEc219xfAk4w0ptW/fVtUHnWz3JCdPL3D2n8LZw yJzgyDXg5gfaZxDUE6agYhL7th6GiGVvoGk2+Wnt94UMFWBBsC/+ghljANpuwFS4 vjaTnv7nl3VLTtF9n56wNne9cj3TrBbCGgNA3PStvUJ85YReuLNH2zXMRAGKD/XZ oCruR3M1J7EMxkXnJqb+NSTuAwN0R+NUG+Qa+3GxcyNo138nj7/1FBJiuhE/pp0o 39tekxuzorqxf5/yXxKD+lXhmDWUErcHE5fQrhANMnioocmWbOTmK39IT6Mg== 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= 1786384496; x=1786470896; bh=KriHSxPk1emrXxSLT/SptcnTyZOsp095J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IdCXg X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Aug 2026 13:54:56 -0400 (EDT) From: Junio C Hamano To: Justin Tobler Cc: git@vger.kernel.org, ps@pks.im Subject: Re: [PATCH v2 3/7] builtin/receive-pack: read unpack limit config lazily In-Reply-To: <20260809190106.1565882-4-jltobler@gmail.com> (Justin Tobler's message of "Sun, 9 Aug 2026 14:01:02 -0500") References: <20260806213859.816157-1-jltobler@gmail.com> <20260809190106.1565882-1-jltobler@gmail.com> <20260809190106.1565882-4-jltobler@gmail.com> Date: Mon, 10 Aug 2026 10:54:55 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Justin Tobler writes: > +static int get_unpack_limit(struct repository *repo) > +{ > + static int limit = -1; > + > + if (limit < 0) { > + int receive_limit = -1; > + int transfer_limit = -1; > + > + repo_config_get_int(repo, "receive.unpacklimit", > + &receive_limit); > + repo_config_get_int(repo, "transfer.unpacklimit", > + &transfer_limit); > + > + if (receive_limit >= 0) > + limit = receive_limit; > + else if (transfer_limit >= 0) > + limit = transfer_limit; > + else > + limit = 100; > + } > + > + return limit; > +} I am not sure whether this is progress. A function that defines a 'static int' internally and sets it only once is akin to using a global variable. I wonder whether it would be too much work to add a new member to either 'repo->settings' or 'repo->config_values' to make the setting truly per-repository.