🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #4336

Re: [PATCH] cache-tree: do not start an ODB transaction for repair-only updates

#4336
From: Derrick Stolee
Date: Fri, 04 Dec 2026 14:44
47 lines
13241 bytes
On 12/4/2026 9:37 AM, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> Since e928a32355dc (object-file: create ODB transaction temporary
> directory eagerly), every ODB transaction in the "files" backend
> immediately creates `<objects>/tmp_objdir-transaction-XXXXXX/pack`.
> 
> The `cache_tree_update()` function begins such a transaction whenever
> none is in flight, even with `WRITE_TREE_REPAIR`. A repair never writes
> objects, though: it only hashes tree buffers and checks whether those
> objects already exist. Because `unpack_trees()` and `git checkout` both
> request repair-only updates, a checkout can now create and then remove a
> temporary object directory for nothing.

I imagine that this has some performance implications beyond your issues
with long paths. Perhaps it's minor compared to everything else going on.
 
> On Windows without `core.longPaths=true` (which only exists only in Git
> for Windows so far, anyway), that is not just wasteful. The `mkdir()`
> refuses paths of 248 characters or more on that platform.
> 
> As a consequence, Git for Windows' `t7429-submodule-long-path.sh`
> started failing when Git for Windows was rebased onto v2.98.0-rc0. The
> object directory of the nested submodule is 214 characters long.
> Appending `/tmp_objdir-transaction-XXXXXX/pack` goes over the limit, and
> the checkout fails:
> 
>   error: unable to create temporary object directory in
>     .../objects: Filename too long
>   fatal: failed to start object transaction
> 
> Since that operation does not need to write any new objects, skip the
> transaction when repairing, and keep the transaction for updates that
> write trees. Obviously, the latter would still fail, but we do not test
> for that in Git's test suite, and addressing that is a longer story
> (involving upstreaming the `core.longPaths` support from Git for
> Windows, something we'll need to do _some_ day, but not during the `-rc`
> phase of v2.98.0).

Thanks for stepping through how this was caught. Yes, there are going to
be other issues with long paths. This change is a pretty solid fix for
avoiding unnecessary transactions. And perhaps is a good thing to find
for future avoidance of transactions, when possible.

LGTM.
-Stolee
Technical Details
Message-ID: <cff126c8-bf3e-448e-a8cd-e9433318ccf0@gmail.com>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-77013-linux-kernel-git=dewy.ru
References: <pull.2348.git.1796395037799.gitgitgadget@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-77013-linux-kernel-git=dewy.ru
From: stolee@gmail.com (Derrick Stolee)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] cache-tree: do not start an ODB transaction for
 repair-only updates
Date: Fri, 4 Dec 2026 09:44:16 -0500
Organization: Usenet Network
Message-ID: <cff126c8-bf3e-448e-a8cd-e9433318ccf0@gmail.com>
References: <pull.2348.git.1796395037799.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2787438"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:tW48zG/6iRVmBel7hP8tozpbTaQ= sha256:XutBrCLfglgKRpd6atwACQtNs+VRJYtJ7085UcN7PSk=
	sha1:qJgs7lSDt5T7wBSTrfQ/5XMMhqs= sha256:36QQQzzh6HZZEIdUb+fJAO7c3aW4t8HYZ9hW9m6O3c8=
Content-Language: en-US
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 124EA117C3A; Fri,  4 Dec 2026 17:44:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.196
X-Spam-Status: No, score=-2.196 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id hYGuwcMYJw_Y;
	Fri,  4 Dec 2026 17:44:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-77013-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 52C28117C2F; Fri,  4 Dec 2026 17:44:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 70D3AA046A; Fri,  4 Dec 2026 14:44:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796395462;
	b=QauSUMrPizsI1SEjmsYNDl01PI+BAPqjtmjBIT/cxpHAntKylvW55n+RC0wMdrdgPH6S
	 5OvssDuZ2AQx/kEUezn8oiNDUo/lp601UirifqusoGuGOabdK7UHSz/iDr7cbulaUufzY
	 TDQ75sritQUvKCAHjxc+WXu/EaxreQv427jX3HLetd32pfVX6U4bk4cxx4QAEkyh3kNNo
	 OAuuNvRuDTD/TlZK37f82uDwO91/iZ7yCYWoA427Gw+Sx5lTQgygC1q8xJghsBK+q9dL9
	 w/MI8/o9+h+aNAcYhOnUFaAKCVfR0mgo7BW383KntNt1zCppdxzF23TFnb33wXGYmlQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796395462;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 User-Agent:Subject:To:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=pdZYt5XZHRTQKVF/MNClC6SHJLXUlMraPq0TLqix090=;
	b=Llg2riFXLO/oec5UawbPWiXMiDwjaY1x8krFo4pACuwtyzBvAH/w8o9PCJr/xHKa+YvV
	 8t3wAw72l0HF7MTq/vFzyYfiUBZWA/eo0vOAbefl9/HzilaXoeuZ9SWPaOGrkSvOjrCyv
	 HEMTSTeUwlZ6+l5uG4XldhxYP0VKBUVs5fw0ddZVXSI2gRQtYzzc1YKgezpna+ejlotWP
	 MeogrrOnyL2wF6tD2EEfgCG1cqLxJmA61q8GWegP4NcuZGovzcCZJQn5F1AIEQqJ3DDRi
	 iw6PYNk+oUW+4Fsqtof5xcC5AECMqc7Zrip4uwDaEUB4GlEXhKjp/vd9Vgbqzpnunnw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=P5aW6c0V;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 49931606A333;
	Fri,  4 Dec 2026 14:44:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=P5aW6c0V
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.170
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796395461;
	b=ONI0sUjZ5mYXunucZnPfuRfdWitbjVlAPhmlhAc3d2A2GSO8+MR/2bICjSuBaiFF3Wkq
	 q81bA0J4AKFC06Fgm/ACumIg8j7NpN6N2K1yugXaDpOYX+N+5xC4gPiuA9Ck+CRNYzXDm
	 aGPqNPOL0MMgBdL79AOt9Xa3DVsl7auodwmEQ9DM6npYDy5/yzKy0XLaVoy3n96ZPEKb4
	 +51v4c/t6vn0bMsV9kFWYc21TqthgkR0GixkOMa2xb3Ej72uvsTngRpErXSVrl1pXqRGc
	 LP1h+LqKGcDdsCm6PpHdjw9xUeFFviy3Mbkn4sJWkUzgtUCaOHynSRPfLr7cLyhWZ3A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796395461;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date:
	 MIME-Version:User-Agent:Subject:To:References:Content-Language:From:
	 In-Reply-To:Content-Type:Content-Transfer-Encoding;
	bh=pdZYt5XZHRTQKVF/MNClC6SHJLXUlMraPq0TLqix090=;
	b=Yc87+O/v3d3E4UJxRb0Rfafnhs+auayQNzrSDinag0NMphDkPCdmPCgJW3VMX7WycHHh
	 L56yr22Pa4Zylz+1gbkzdQ6gx8Wsim8mGkOah4IZd7vG8arNDmS3mOrImAGI3dTAty8fh
	 IV+So13cR5gv+m3trhnqp6ZwktPCIEe3GXEbSFEw+NgMNlLTBwlbvyCMuiCtAMLBLYzvS
	 i2fTA8AgHvChJ72wmCUBtvbMgeFh/87eDk3BNgSLr7AUVBQIjW8vuD4jz2ZMgZezt/JID
	 EqkXy3vv6FcwLiguWPO+wthdUI5ZkOsPiO3tRlYanqFB40RuXH5kNTZlXxwHTXhbgmQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=P5aW6c0V;
	arc=none smtp.remote-ip=209.85.208.170
X-Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10211606A322
	for <git@vger.kernel.org>; Fri,  4 Dec 2026 14:44:20 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 10211606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-3aff2ab0808so6775341fa.0
        for <git@vger.kernel.org>; Fri, 04 Dec 2026 06:44:20 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796395459; x=1797000259; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=pdZYt5XZHRTQKVF/MNClC6SHJLXUlMraPq0TLqix090=;
        b=P5aW6c0VB46TpOGdQrWNHMLFOuGPlpTd+II2CdYbInpOQA5pU0PLS7FVywH3NOHW4f
         6Ks1UQLeoulTCeCPucp7Y8maBVM3yHFAz+ZH/eC4/E0HFYK3h6uJvGnOmR6zcxxh4Yki
         yzhrBCm5GOni3CrrpPbbP1j9Ro6ikC/0EfKJvX0PLeAVU7mT48gxaD60L4QeRzwiDFHi
         nSnDwSKZmghjSMU0PmpHCjym8kjaaeitTeX1gGSTZ1eFRqfirZhVIZCtDzFx567HVK/j
         7AfSsTzl1O9YHs/CNWrhZ2NjaLOSrpmE7GYPJYeivK7vPpeMgzH0RgFFzp4zKm+j/biu
         bFCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796395459; x=1797000259;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=pdZYt5XZHRTQKVF/MNClC6SHJLXUlMraPq0TLqix090=;
        b=Y7E88sSb/Ang2IwJXAwev836xxCpcHkmxUVRwsBuZw4UZOJxp49MuyMlvKfa8ZxEG+
         hX+lHX8U+B3xLrbh60jhxEUkbtb9K80UKnXqPS0BolRD32hYxU5VLSr5nSUWfkrYxRzH
         G0TezYWMDa1s1OOAhNcQE7fL4TQLAruhoEL3jmaiujCOc5kHYA9Kvcjd5TFZsxpLHFj3
         2tm5dagh5JuRcXXZJgm2oBEj/cOmsxLWAKdLwFa97KJ0bN7nejdjR2NdvtrHSEDUkm6h
         TMvzmmWFBWATsZLODjezfsW3GSh/E5TofUHSR1qvKwO9OIcz6nF22Uj8OKqGp62VHQ+0
         sEuQ==
X-Gm-Message-State: APuU4Z8go73wWuszrLXZ82BgH9ZhP1e9+0O0unS88ARuCR8qd6jaOyoy
	wRP+0p0beBfT29SjbRlfWbalVWKKNu8ewLNUJAvaBonSYGOvjIQDG3CnkKHESeY9
X-Gm-Gg: AZFdTZcTqMAlvHioLg/p2zftUzYaHNyCIbIjij9DgubMiRsP5IfAMNs0YKXpkzyNucm
	B/F0vpf5/blw9QrSzSM13xByNX/9SOOXc+jRQgCWKMTo9Bb+ksE30NNZYzwq0iuX1H1xDsqJ+cq
	uTQV/LYgsZf69zgWnKdsV44w5OEUW0wYNRQKYlp2hUVcEF/SSLSFo4XlH6PAcCuW508yVbh/rPV
	5vc/cPckXV7Q769MPG6YAgagifxEZFySbRhAprBmnUCpECPAk0oHev5O9oB4aQOO3aQ3SbKptwZ
	lEWPbYZfobGmWkWY9VcCygfXmP2PkG3+SuDnHS5EvufW5pC3T+7VB2U5Bn86x/F075UFhiT7FsZ
	UB9d4C6Kw9KQLZMRAzFyncQYha2me3g+P3IjABZuDdHGN6sLOo7pLsrNz/Mi8/8OV82RNtVm98B
	YM7QonB7BmoANsGvM3O3wM+pTyFr1sWhnwI/tz+SW3yPpUBdRlrrg5SVArB73OaKeiXsS6UVY2l
	R6yE+DP+QCBxPySf33ZHAhcu0FDIZ19aG24cMdI/jgVZcbGN/rt/q3kM9TBYdO2n0+4t6UzkKUo
	tmjC5Srp3lYAxGFy9uG7yZXPeREAclzO7QupeMMPHT5WsQd4VqNqlvYv1hiLAfrHJMf6ZXfqel4
	t9+aBpQ5VgVynjI43PNZLrFan2KSg/+S9k0IkBTBt2mxQSn2G2VgjbUebgLl5PsmUxZsG32aE2d
	gsr0/uhzKtTnZKbI1nwDqDvr9cvgg9nSMrX16n1nd1DQNe2cXv4K8RgQ==
X-Received: by 2002:a05:6512:3b88:b0:5c0:46a:af07 with SMTP id 2adb3069b0e04-5c3861781f6mr633411e87.24.1796395459107;
        Fri, 04 Dec 2026 06:44:19 -0800 (PST)
X-Received: from [192.168.1.109] ([136.61.86.144])
        by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c384aa8795sm664114e87.77.2026.12.04.06.44.17
        for <git@vger.kernel.org>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Fri, 04 Dec 2026 06:44:18 -0800 (PST)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-In-Reply-To: <pull.2348.git.1796395037799.gitgitgadget@gmail.com>