🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #1229

[PATCH v2 05/13] object-file-convert: implement mapping in terms of object DB

#1229
From: Christian Couder
Date: Fri, 23 Oct 2026 07:25
48 lines
12475 bytes
From: "brian m. carlson" <sandals@crustytoothpaste.net>

Now that we have odb_map_oid, let's implement repo_oid_to_algop in terms
of it.  We still need the latter because it does some cleanup that needs
to happen so that our object database backend need not deal with these
issues.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Christian Couder <christian.couder@gmail.com>
---
 object-file-convert.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/object-file-convert.c b/object-file-convert.c
index 63ee18630b..90a75a6c21 100644
--- a/object-file-convert.c
+++ b/object-file-convert.c
@@ -7,6 +7,7 @@
 #include "repository.h"
 #include "hash.h"
 #include "object.h"
+#include "odb.h"
 #include "loose.h"
 #include "commit.h"
 #include "gpg-interface.h"
@@ -35,18 +36,7 @@ int repo_oid_to_algop(struct repository *repo, const struct object_id *srcoid,
 			oidcpy(dest, src);
 		return 0;
 	}
-	if (repo_loose_object_map_oid(repo, src, to, dest)) {
-		/*
-		 * We may have loaded the object map at repo initialization but
-		 * another process (perhaps upstream of a pipe from us) may have
-		 * written a new object into the map.  If the object is missing,
-		 * let's reload the map to see if the object has appeared.
-		 */
-		repo_read_loose_object_map(repo);
-		if (repo_loose_object_map_oid(repo, src, to, dest))
-			return -1;
-	}
-	return 0;
+	return odb_map_oid(repo->objects, src, to, dest, 0);
 }
 
 static int decode_tree_entry_raw(struct object_id *oid, const char **path,
-- 
2.56.0.215.g47fdf2208c
Technical Details
Message-ID: <20261023072559.3204273-6-christian.couder@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72951-linux-kernel-git=dewy.ru
References: <20261023072559.3204273-1-christian.couder@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72951-linux-kernel-git=dewy.ru
From: christian.couder@gmail.com (Christian Couder)
Newsgroups: linux.kernel.git
Subject: [PATCH v2 05/13] object-file-convert: implement mapping in terms of object DB
Date: Fri, 23 Oct 2026 09:25:50 +0200
Organization: Usenet Network
Message-ID: <20261023072559.3204273-6-christian.couder@gmail.com>
References: <20261023072559.3204273-1-christian.couder@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="436848"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:muh6PtqAN2VArSZpGWtXJhEHa6M= sha256:TbM+oqjVTmyiMX8D7V9gP3xbox0vdFW3SupF8czl9Kw=
	sha1:f5NocnP4KJQwKXid1yX+/5jj6I0= sha256:WME3N8/GMR9/TCs0n9B+5teJmB7wDru9+IvjVoteqbQ=
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 E93C5111413; Fri, 23 Oct 2026 10:27:28 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.148
X-Spam-Status: No, score=-2.148 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-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 Z37eff4jiPe9;
	Fri, 23 Oct 2026 10:27:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=git+bounces-72951-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 79ACE1113EC; Fri, 23 Oct 2026 10:27:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id A180860509B; Fri, 23 Oct 2026 07:26:32 +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=1792740386;
	b=TM+PWozZQDKLzPgJhR8Lj9n2HLCR43q/M+C1Cr+yoJwO8QnDQhMGGasGIVITPloaT5oE
	 Fy8MqMVo5nTV/htKYzP6Rd1aTYlsLZ+p2mXsrZEhHo5zm0+SHaDCteuKDkZ3u0iFp7wLD
	 gwXGL9t+dIasUbvtFhNda3XZTC5VEwsB+nxjR2pNfOggxm13PviL+96CZ1rXN+NxFoxO6
	 0inKh19XnZ7sk5T/AaXW7Xld0wP09w4B1IM01HRoCkKEUVKNQCR2VPjeyiI0wjX5c4HUZ
	 uZTp8/kMC/sSnn6rsWas46woB2Io6LeDU73lqsy/tjdoTb9EWzishINEiIBYeVkuZng==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792740386;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=7GQJkRufc3jnKSZclhlopVxbB/mqive+erFt1PfjEBY=;
	b=YMEAdnZfCoxNhFnCdu0pWwDsHiOUhSOFnMMGTsOnw1KkpuffJ56lz0MMw930AeTucykB
	 SNMLrioiHT85BvguGQ6npprg/PvB7EyUQIn+v+btYA7lDwrcGfFb4CCjPvQjTSOvigPty
	 39jD6oJK2YIbIWmby60c5aOQy/dP14pAwAt3Q3i3exAPXyua8FbAHeVionxveDajKFQWT
	 lLFVEDmelDUYwG6ha5dOo/NIECp/sd7JFJnqwZYANoppc7Dm1qaCSzgYs2EWrdCcKGah6
	 XAFDBAM1LWXkZONLj7b45/TehIOFv7Pk2gA48n+gxSGfJj6TdXxPLHt1XIxRO4H9XCw==
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=20251104 header.b=OTKBjDCT;
	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 B399C606A323;
	Fri, 23 Oct 2026 07:26:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=OTKBjDCT
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792740385;
	b=VVnwyx1jTqpw1Fh+B1G7PQ8XE6ZR9CTyHyOQJgniiWQQvTPnRk2M+q/fa+WMNDqpJ70s
	 qvWFfLJWHAC/Thq7qU27ErcmOKgwjY+znp7YwDoMMXxchHlUi+V26jNJIZsUbhB2OVMt+
	 +kTocbj+k/goIvmahHPGxen/70XA/XPd6xLjon0DONyKFhKfPQaUBePVjjOcyzdEB17oV
	 7/IKNoUMW5smt7wMRCX6BrnqX3r0nSVA+60vg2gxp8rotahluDHGqkY/yc3zEPnsFrkgn
	 gSShvH/Ndk9S+1BzbIID5DOe2kJyEOGWceu1sBDJpedPNgjOhSAafejB5fW76OvMP+A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792740385;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=7GQJkRufc3jnKSZclhlopVxbB/mqive+erFt1PfjEBY=;
	b=DpPFC4eKVBmQjz0UCY3CP+kNEYKp/BzXhlz7vGrE86qQQhq4/tc1UTPUjPqYBuRtI1zN
	 Tpo602CL0pc3qJBvNeEFwHN4jIxlQKZtTxN0JNjhGuhdFgAlXihIl/tz3lBWFaua3z479
	 tnR6zvfBGl43Shx1mdIKfvjfEAkxuWl4nt3nzuqWt3W7t77yzBENUbvXVebnI8p6B7qWr
	 hUpo2AOGGJos4lzqr8eFQK4kHscOfTJ5d8ZWFfS7YGQegmZ5Knt1WQ6roGJrlewtPEYG1
	 23DWFMbEs5+0Kw+88k0U1PUfOPW+q1zoz2hwrdnxJ2mF38YzwF1PPydub+FunHfmeTw==
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=20251104 header.b=OTKBjDCT;
	arc=none smtp.remote-ip=209.85.221.45
X-Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45])
	(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 8574B606A334
	for <git@vger.kernel.org>; Fri, 23 Oct 2026 07:26:25 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8574B606A334
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-wr1-f45.google.com with SMTP id ffacd0b85a97d-48c4d99c32bso362898f8f.1
        for <git@vger.kernel.org>; Fri, 23 Oct 2026 00:26:25 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792740384; x=1793345184; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=7GQJkRufc3jnKSZclhlopVxbB/mqive+erFt1PfjEBY=;
        b=OTKBjDCTu61tMxSaXVyR+RCXHTpQu4Vz3FwmGijUhExA7kqWObZw4ej3ZgC969rrYv
         hrM/SmNx6lPT+VLBdWgaE3EPHtJOln4VrhKs63JXg5lp/F3F81z5IKA4q9VCHuYC3nIv
         cKCYfveUShD2POiCaDvjz0ldkAR7qVUoQlDZkLPr6EdV4cziD/qeNB1DOSdMZTsRKkIS
         COPj3PnZYUWb4pJ7geCXpoJxqAmIW18Uw8kP6HS+hdVPfBILQl21bZBod2F/7nuOewPY
         Bmp7nFlk6rWiBsDdvR0z8VZVBX5R3Bnq7beXIPGE6ubKLix+HS2os6DFPX9wc4I2jV8Z
         +6EQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792740384; x=1793345184;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=7GQJkRufc3jnKSZclhlopVxbB/mqive+erFt1PfjEBY=;
        b=gR/0HXSwRs/P8IkHOTaym8k3lqs8vjRSQFPnje8rVAGbbIN9FwJzzMGWr4PyYQnPax
         gNvBnaBgsg56/ywiSUa7ReRKNxgs6I7s+qlCma22LnxlkBywUs5bVDAl3DN77uVy33nu
         ltjJI4OmhigmFGrocNq8Nevu1K0DNwnZDNlcjqjUgAarPGyIgwAfB54sB1G6DeQe8CzQ
         VP2vkjOcYTp5sHCT4sqeV2F8nNe2Mdri5L/tSlUpI2GOwC1vBdfvXaQzwt/EO3o6L1NU
         RpREEqMerE+wf9j9U4Wd8SzhM/sgcUVLFKXUxL9RRiNfej2XFwHScwcQZaqBawVuw94L
         w2qg==
X-Gm-Message-State: AFq9FYKvuH1y/pqwKTBoxWLiA1dwJ+d4MqiPRNCxZOhQLdctjNuSTE/r
	bwFsYbirTcM+157fSLvnldqR9h5auMY0Q1Gc5CfPUiY7NY/omsXBp0IFBMDH+g==
X-Gm-Gg: AYBFou2k3JFGFSEMv0MN1vlNrYq+quLJtqsU2E3mN6R1VUQRe3oCNI2T+cuh+3qxxwR
	KqYwS8HjLQReXf1iqNftgmBt0ghPHy2l0mcHDf2Grq7puPcwVSJl6XYDGokPe3xYIZ5N3cU9sLp
	VSMT9lfF1FG4JrsLv/YJOWNgyFR+KW5D5nk4sD625W0lr8rF7U2tSGBTEGiTHHo+q4p9jXIn6ZC
	TjnbVK5VZvQSqDlqA9CwsD5qULsudqzyYsScu0PCrv8NBp9SJG7i74sAei/33FYvsIWm0d1F05l
	fURAR/pz65M0nV61HlcIp91s4DldS5WQGsc/ibbKJAUuFpYcbuxHw2yufB9grNzA1LzEmrW+z/Z
	wJ7sN8CuLaZN5s80GWNOL4Ptf9vPFLGcIG85OQ+gj0YLQ2GOo7SXArgYnjA0gsWAuWzlV/XniWZ
	IK7BN0Cfj57ukLPKn/YWG3x+eA0fqIaP5cxSdFFm11iC/KAWBKhRj/h/H7eyGJbNCqi2qbSP2Rd
	NcPAGLs9g1SIO2eBlfJ4jD/aZCY3ixkvmVQR40mxt2XoJa2rTS8jnGIKHEGFz5OWBKZzDNbHQhE
	qaBfsvS4rQ0TgPUk3lmuWLnxqFeEs442a72Dh4V20RJIIcAuXZjmaQ3NVy4FASA7BRijkSkxzEs
	palRtGSzfw+Zx43x/0JNV7t6ej1m3GEFFtrUHwdWLByGCT0taH4K+3F7S83jrMmBBhg==
X-Received: by 2002:a5d:5d10:0:b0:48c:571a:a1aa with SMTP id ffacd0b85a97d-48e38594bfbmr2036224f8f.19.1792740383622;
        Fri, 23 Oct 2026 00:26:23 -0700 (PDT)
X-Received: from christian--20230123--2G7D3 ([62.35.114.108])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e38055da4sm3228024f8f.43.2026.10.23.00.26.22
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 23 Oct 2026 00:26:22 -0700 (PDT)
X-Cc: Junio C Hamano <gitster@pobox.com>,
	"brian m . carlson" <sandals@crustytoothpaste.net>,
	Patrick Steinhardt <ps@pks.im>,
	Elijah Newren <newren@gmail.com>,
	Jeff King <peff@peff.net>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Christian Couder <christian.couder@gmail.com>
X-Mailer: git-send-email 2.56.0.215.g47fdf2208c
X-In-Reply-To: <20261023072559.3204273-1-christian.couder@gmail.com>
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