🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #994

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

#994
From: Christian Couder
Date: Wed, 21 Oct 2026 06:32
47 lines
12367 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>
---
 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: <20261021063245.2917625-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-72654-linux-kernel-git=dewy.ru
References: <20261021063245.2917625-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-72654-linux-kernel-git=dewy.ru
From: christian.couder@gmail.com (Christian Couder)
Newsgroups: linux.kernel.git
Subject: [PATCH 05/13] object-file-convert: implement mapping in terms of object DB
Date: Wed, 21 Oct 2026 08:32:37 +0200
Organization: Usenet Network
Message-ID: <20261021063245.2917625-6-christian.couder@gmail.com>
References: <20261021063245.2917625-1-christian.couder@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4048433"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wi6mnF27Sv7BORTJM77EMDtayIY= sha256:naVOx+VXHA8e6L7YqOEn9/TFIZzitr9vaSYgZr/XbWc=
	sha1:bdBlvCIIMSXFRSEOWKgJLzmETw8= sha256:gqY4x0Ly86mOIdH5haydRoUvVUo9LVMhBV5ynUsC2fU=
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 B0150110F3E; Wed, 21 Oct 2026 09:38:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[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.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 11QcS6i-nOmN;
	Wed, 21 Oct 2026 09:38:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-72654-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 783F7110F3B; Wed, 21 Oct 2026 09:38:07 +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 2EC783D8C3; Wed, 21 Oct 2026 06:33:19 +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=1792564393;
	b=UhRAPpaWvXYt+MB20DtgXgwieyExHfAo4jKfkHhM2iLI+Ji5vlmFugku4gsLIOqLpAmZ
	 kIiiz90oQRUbo7A8kCRohwYTMNNGFylE1pxHG6joObRDOitrOybt0Jqs/Eq+y0EILgTEs
	 sVszsnyWp6bama67C000qV/ngM3TmU0l27dWkh0n1Cb9j69EBjCkZ6+q5wRY6j5kRLADF
	 bJ+mlkqQ4M3RcuvkkB2LvcH4eq6NQN4x3mNUqIbwkVRrgkLARoCiLUvH+4WUG4FasChOR
	 hPiwj20XaZr3xEOsg4C7+R5TwrvLrYq9aLhRoY5clNaU7cTLOi1Urzki4JXdwTkBbvA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792564393;
	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=s5BbDUD/z1fV35YsSAwcthiifX8VrNn8MrkvJprKoUs=;
	b=G1P761mplHA2p85luxcQ9SGHq5JeyqMM8xuaCT5t7BAKguHrYXjcuALNcpZQeJEIk7Z1
	 J4qjmWiL92pHZ6WlfLTtz4U+fazhIFjIe+4+MBa43YJdwVpy9L6EqeYOoLgVF5U6vpR81
	 G2qfl8N6+ygRdnnFSDdaW3gxl9Fq5O/BpmJUU1l440pcgmc75KpB4zquE3rjBrWNtl7T8
	 bKbMi/WwzwOZ+fM5+ZHuoKH+Q/jDImdsrfKw5gXuzhmJ97wA8cEUPwca3MfrOIm0B90Wj
	 7HR28/3kkgMF/rSd+c7DGOGLwaBaHwlKgrG5czRWbvUNwyVsqu+6TdG1HLul/FjbI+Q==
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="eF//pBjj";
	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 3B327606A31E;
	Wed, 21 Oct 2026 06:33:13 +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=eF//pBjj
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.42
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792564392;
	b=kgaaqaGFPolygPOqqnAo9WhCPd3w5qtb4wRdp0MNmpliXszZdhmp1P7yfGR2h/2XBOD4
	 pTS+DV11thxSNIHtyEghuRtD98UnZn8e1ho6KzKHFVWz/2gIAn7Xd9/Yop1PANE0WCyZs
	 TaDJ+lQ5XKodWDtAeNmDTS4562QsgP5THSfagwm5kyGq0CCaVKza0/+SNsXTyPmpyUfMY
	 jOnVefPXa5GBtAw3bimq1lsE2Z4E+s0bexXbY0ofOXXvQb4/DQ433tpFUsy8Mpq7/4nX7
	 qaa33OTgGZlJ6ij8Fq5OLln+2Z6Dcel56Wf2UH/6pUkgckRxnyj+P1WuLm7xMLmQhww==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792564392;
	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=s5BbDUD/z1fV35YsSAwcthiifX8VrNn8MrkvJprKoUs=;
	b=yoL2/0ffVMg1Ph9SSQhjGEAHdb5LD2LUTjf9P6dPmw9D0VS+DevisuEWQSdDMTatI6gm
	 m5bNbkSH6tq62O12uDaqG6XSl9RUenRa4TqcTe8V2To1yRQn4HPk7xGu9dqKE1VDk3J10
	 vXUbZzw3B24l2VigJyXc/FJJ9xaOfDB8xvOfJBWHKVXnNTOXVjwmTm1jndfFkATBhMcca
	 vaPWto+jokVfpUqncov9ijsYQa4Z4zW/JIOKE1VXqDcqR5Qdf67IhdEJRVx/uaqeFfA0v
	 01Wp+3Uawl+E9dQOAHTyDvyaMVzzZgO6tApgyIWTnNMahdKi4OGB0OKIkvVU0nt6slQ==
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="eF//pBjj";
	arc=none smtp.remote-ip=209.85.221.42
X-Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42])
	(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 0832B606A328
	for <git@vger.kernel.org>; Wed, 21 Oct 2026 06:33:11 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0832B606A328
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-f42.google.com with SMTP id ffacd0b85a97d-48e0d1c095dso174270f8f.1
        for <git@vger.kernel.org>; Tue, 20 Oct 2026 23:33:11 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792564390; x=1793169190; 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=s5BbDUD/z1fV35YsSAwcthiifX8VrNn8MrkvJprKoUs=;
        b=eF//pBjjzqXgCorWttnYjuTrTvpjoviH20ed9tQKPY1FWIml+QspIUYMKMh/e2UBJ/
         QpC/LEmImSfFYAQjrzvOwHIJ/yBQ5teP+PIac3GcOS/t2GKBmMpT0KtBvvvUj6Wj9ruL
         Q30HmzROp4TKZPjVg8wqGmF4TuRO0EjxcO3KvU70JfI4cME7AUpf1EeRZbTvqM18zUSu
         5ROzFUjVOr+Fg1DJhinIbBPpVmSJqCOxMDsTsNaK5/DaCHSqLXdP3DXWT2dJXteN00Aw
         O9hFjyb5e7cuTPk7/Z2sY6ZYiEzx1wccphwOi/BjUupAxHVeGzJVnbQNO8UzTftSC91T
         YrRQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792564390; x=1793169190;
        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=s5BbDUD/z1fV35YsSAwcthiifX8VrNn8MrkvJprKoUs=;
        b=mHk6j5GYbZz+xNI8uDnu5cdUTY/SM55mg/HDJgkl05MCsuTCmFT3a6QEF57OeraMNZ
         5E4AD1QYxx1dExUypISsbMia6MJqBCix7bvieazAahX00N9A6gTxHZe9XorGQjgyruGv
         EeOU1YhI9OwF4yz+ChYT6wjvYPvYtjEVhfW6vuhFsOrZ7tAAi2gCDqvJNqshQskXWc2Y
         btCLroX21XyIf5aJYZHazCikAYLAz1Vknfd+9vzz2EhlZg5PGoJnH5Tu+AMJGPBARTqs
         QYT/9cnoMTntQTlYWmek7tY/aHD5lZbQh702gkOSj3KAZJkXXnEt4YExQOLxTVXOJhe4
         KXIw==
X-Gm-Message-State: AFq9FYIpu9Yiyvn1cPgctRaS+ZIjDWzR3SvqePwFXixlexFkNIb4Y5bd
	cPAFMWWRKeV97ZATrU+SLG5em207ZHF/9IZ0pSsJ7cF3tjPTz11ZnmVMgdFhTA==
X-Gm-Gg: AYBFou3tZuOXEwFgl/JfypZ8l5p/Er5bSmLOFjxmyxx3RD6ocwk5BT3Wj1dWbcMHAjz
	cTp2tQUeGfvjPmYCyctjxM9A4LB7cLm1QCTrxQJgRhvC65EHj3sawYkRNQySU5quUAZtlIQUTKg
	qwjuXT/87a0IUKr6D9hMpL6iTnjF2+ozAg6P4gPBbgdiAPY/9Nl7C+UaqnoouNDHi3rxnkaRz0b
	5casZKCt4s55n3eZ+PSABzcIhNkAxNmMSifOTHCP8Z/mJ5kHeCgHDBbIjVc/htZvtr6mhy/aBN6
	GSTiJKS77kM1qUEOUxoPZk0hD77V+WMf7jgVKBDBC3dGirbHoqIF48fCrcHKZjCAB6W5jhsOg5H
	2SEkL9QaD+fymQl1lGWLnk47vljykh4ETXFGzsx0GBwSrmgmktm5hN6FEcf/7SBrFLK1NnbToqN
	iO0YvzKIwdyDhufVFfuamafMqI4EPLNu1vM7qGCyrBTTFoORN9NIlnweHnCPTauFgZK1SO4l1y1
	5fKLMx0G+O82S2eTx4IZYZ6zO6RVi4MYcAN4ApTDB92D0RyaV3dklUgxGKQkdKlU+CBNG1G5Zak
	uv8eTdiVv5AxMlmUPoj3FPZEvQtWnVxHxDpCS/tkp/lyN62IMgqeNp9+fAoELTTkgwTHLONMpPx
	68rVdRXHxYUH826UIoe9KukN8yb7kR1JKrODS5AH9RpsYI7XESIVEnFycmqJqRMfjmA==
X-Received: by 2002:a05:6000:1608:b0:487:a15:b4cc with SMTP id ffacd0b85a97d-48e264b1611mr1338570f8f.23.1792564390325;
        Tue, 20 Oct 2026 23:33:10 -0700 (PDT)
X-Received: from christian--20230123--2G7D3 ([62.35.114.108])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e2581eedesm3130790f8f.14.2026.10.20.23.33.09
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 20 Oct 2026 23:33:09 -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>
X-Mailer: git-send-email 2.56.0.215.g47fdf2208c
X-In-Reply-To: <20261021063245.2917625-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