Article View: linux.kernel.git
Article #2832Re: [PATCH 1/6] object-file: move logic to read loose objects into backend
From: Kaartic Sivaraam
Date: Tue, 10 Nov 2026 13:10
Date: Tue, 10 Nov 2026 13:10
54 lines
12925 bytes
12925 bytes
On 11/2/26 16:50, Patrick Steinhardt wrote:
> The logic to read loose objects is still contained in "object-file.c"
> even though it's an implementation detail of the "loose" backend, and
> that backend is nowadays also the only remaining caller.
>
> Move the logic around and remove the accompanying declarations.
>
The move looks justified as mentioned in the commit message.
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> object-file.c | 300 ---------------------------------------------------
All functions moved from object-file,c are properly moved over to
odb/source-loose.c and they are marked static which is also appropriate.
> object-file.h | 45 --------
> odb/source-loose.c | 306 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 306 insertions(+), 345 deletions(-)
> diff --git a/object-file.h b/object-file.h
> index f44758c4f8b..65ab44542b0 100644
> --- a/object-file.h
> +++ b/object-file.h
> @@ -21,7 +21,6 @@ enum {
> int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
> int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
>
> -struct object_info;
> struct odb_source;
>
> /*
> @@ -122,50 +121,6 @@ void hash_object_file(const struct git_hash_algo *algo, const void *buf,
> int check_and_freshen_file(const char *fn, int freshen,
> const time_t *mtime);
>
> -/*
> - * Open the loose object at path, check its hash, and return the contents,
> - * use the "oi" argument to assert things about the object, or e.g. populate its
> - * type, and size. If the object is a blob, then "contents" may return NULL,
> - * to allow streaming of large blobs.
> - *
> - * Returns 0 on success, negative on error (details may be written to stderr).
> - */
We're losing these documentation comments during the move. Can we retain
the same above the static functions in odb/source-loose.c?
Rest of the patch looks good to me.
--
Sivaraam
Technical Details
Message-ID:
<6a4a230b-2f8a-4a26-ae08-8439a0f597b6@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.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-75064-linux-kernel-git=dewy.ruReferences:
<20261102-pks-odb-loose-cleanups-v1-0-fbbc86c29693@pks.im> <20261102-pks-odb-loose-cleanups-v1-1-fbbc86c29693@pks.im>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.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-75064-linux-kernel-git=dewy.ru
From: kaartic.sivaraam@gmail.com (Kaartic Sivaraam)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH 1/6] object-file: move logic to read loose objects into
backend
Date: Tue, 10 Nov 2026 18:40:59 +0530
Organization: Usenet Network
Message-ID: <6a4a230b-2f8a-4a26-ae08-8439a0f597b6@gmail.com>
References: <20261102-pks-odb-loose-cleanups-v1-0-fbbc86c29693@pks.im>
<20261102-pks-odb-loose-cleanups-v1-1-fbbc86c29693@pks.im>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="614936"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XEz/f+KleRa1izXW9nSijyfMKtY= sha256:POP2qfNHeeeEU9PUAgYkKO2BY+iGcsNEw2cY3FQnbCM=
sha1:g9n9vNMAHnITZpeAVFWS/A0phdQ= sha256:rqd16Vtw+tykTrR2xGXrLhhsu3yrwAEl0QW/rTpwyJs=
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 33632113BA2; Tue, 10 Nov 2026 16:29:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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.249,
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 zbmg-mJAxmHk;
Tue, 10 Nov 2026 16:28:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-75064-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 1B3BD113B74; Tue, 10 Nov 2026 16:28:49 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 7BE48144B17; Tue, 10 Nov 2026 13:14:17 +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=1794316266;
b=aZkW2ZX0xx9sJlwLuRrgoqZ9BgGLY5VkGERV1wyABoOdpgIQDtl9tdH76/8t0IjFFCvT
qpGRPo8HF2bldRP52P7C2ZUxzp12TSnSjP1/7FAADgdlPh+Ju6G2hUk0PLByukoNESoAe
Mff7mt2CEdKPiYzQU+ocEQnx1h1WZMg140ObBGy6RQKaBhzmvC2RMtkQyeUcYvonteZAi
uaXPLPh6fQ1xyqsInVZo9/EO4N95dG0rc4Yo7UI8NODS9NIvk4KMh8BXZq7fpLeobeC7U
5vmOCNnmayoE0/VOo6QI/hg3GcTiuC8dKNGLVVocNyQFR7MWQUQscN7yOMgyp1tZVBQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794316266;
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:Cc:In-Reply-To:
Content-Type:Content-Transfer-Encoding;
bh=qiYiN8ixT70ckl/CeWCXGAwePirInhpUhTzfZrcdzIU=;
b=vKv61Bs8v0KvlQLfxs9oWoTxCeRlIWwoXDI2KpohSV7KTOVi9MYPyqhlgee0X+kqpv65
sKGgU8u4EXlhVYbLwvu/6+rCpWcjx64hKhxvRPJnCDXei9KhmX5gvQ741WHuGYjuUfmhY
19wXz/4KL9emFCjpY3szloRL7EfVXC4hdaK1Ptp0z98GcZgEQJZ/M5vCJ2gmB0bu0/Ds9
cFJ50KaZG8L8fXv4j/lebIoeCySUHHdhExyCJlvldGUn1LFbzkwCpFyvIQkh0NQokChPN
qZf7ok7FT81sItMlplK4r9sD07c1ejo6kivuAQY8hd/ugGtamfG9ocTC3ul9CV7O3zQ==
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=l01AWWjo;
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 A1ECC606A7F2;
Tue, 10 Nov 2026 13:11:06 +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=l01AWWjo
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794316265;
b=PnVsHDBLZRMJtFGRf/5wjAy8LoU8vTzOnKgBXwx1oTjlV74wcyIkH2GWm30aoRd7KF3Y
zwWC0sS3i5M5tA1/ZS0PvxdxiQboS0uY3tqIQMx1Qyx583wFk3XRBVg/++Q0amlkpximm
HZSLtqvXxOvUEpXW5PDtqeRCW91RAuTMcSOf5j8ez2DZOGCPgggKOiZfVL/wD9dfLHOJT
SZ3E8Sge5Cgk3A7vo4vpufE0hyWCYeHePTh2spYSXDjGgr5Gxz7AT4U7VRPOEo6DCZHEH
g9d9EGjWgSxYUOWxV7lKfqFB3w5TEEQ+Tk1rK0Ux/H9TSrdf9fH3YDPNXxHb69TM7jw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794316265;
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:
Cc:In-Reply-To:Content-Type:Content-Transfer-Encoding;
bh=qiYiN8ixT70ckl/CeWCXGAwePirInhpUhTzfZrcdzIU=;
b=oiT9izi2CoP2xzWO9tHADollNxkuRiBQE4d7NBdg/HXIjKB6pd6Xhb9QINe6Jv8O+qSa
YZYa+R8fDhr2hIZljFZrTyrb/k7JJ53Jeczv1FxBR1E9CjwWLveLik4zzAE4pxLv4CavW
1SO6wMtK4kTIqh3M/HwWoaxLkAVZ6QlRP1O1kcyO4PMHzT4KSOU/bVdeRe2NgYUF5sCo9
kyCoC1k7OUKYcD7nwQtyH+qdqVFoiLczzzMWwUg0BhBRIpXwk96J1oEVJcLkQsBL3Gofq
rLP6VbjQSEvlpvyrkdJPCLgD3mzxI5mjFF5p13y8FJzCIrqMKlAMNc7V2uaidDTjlcg==
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=l01AWWjo;
arc=none smtp.remote-ip=74.125.82.179
X-Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179])
(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 75C16606A76E
for <git@vger.kernel.org>; Tue, 10 Nov 2026 13:11:05 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 75C16606A76E
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-dy1-f179.google.com with SMTP id 5a478bee46e88-36fc0a3fe93so3942581eec.0
for <git@vger.kernel.org>; Tue, 10 Nov 2026 05:11:05 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794316265; x=1794921065; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:cc: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=qiYiN8ixT70ckl/CeWCXGAwePirInhpUhTzfZrcdzIU=;
b=l01AWWjozI+rIkzch5fUpmXwpawB6BRe7Xqfg3XMnzTQEQVTMKFIJfBs+wnH2UV8lQ
nzlQ0FtMvqKehhoDq0tBeTmtz3WGjbLTKBu6GEPFTa0tuGOa6lIokWe9umxcET8GdI/1
qVpfuSdZDC4vrHPyBnOCeLjZiFiJquaAOxAbylEgqJW1MAJEHPYFYUj57u/BQoV2uykD
d5KszdyZwapoVYFNnFooITZlspjxI4nMvQXUdmA7lZFOTGKFu0p/+N/nyJeZ5iT3vYce
wm20WGXydoSSHnYcB8LmraavS9h7JcpuJx9m4kvH4JdOQE6vO0J3gAeXRSiuaKXwxK1U
eYTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794316265; x=1794921065;
h=content-transfer-encoding:content-type:in-reply-to:cc: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=qiYiN8ixT70ckl/CeWCXGAwePirInhpUhTzfZrcdzIU=;
b=hCQzqZZmwVM2+MSqCloilSNHrzY+1Alxqs2w8oZ3M5drtnOzTZIiR2WM+68gQyZya6
7VjkBSwL1ow87tBOjE0kRiL8S8SN4/ArEDgS4Af2kXw5CO5foGQo8/wq9fUJEo83wjLU
mHca0rmuFkQzQ2OsWh3K+/TGQIC5HIylGw3Jrlo4WmRieo8ElITInTMGdzgz4pULTKvc
eZxFxLCZR4jl4oICC6loUHeoQCmZ7KtPSNMQnT0HI2+NBL32Q6AU03Jh2m97+HJAeKsW
z1YP3bqSkTHFt/Lu57Z8abhasnYaKJnXp+9IYarbAJVEhC8f3ZJncBGgmwW58N1YhIX8
azzg==
X-Gm-Message-State: APuU4Z8BZFgJJgV5fMjID2atYf6XnZAHKY6lPhDpvLKs3u3a/j8BWhrG
IUa+gjAHek/ODFhTtw0pBTeXhMb9WHDJjCjdfay269Mb2PyScOJNOG4Z+31chHmu
X-Gm-Gg: AYBFou1ukyxhJqUJvfp0/+PdXaPnaDAMJIH7/GIxDZMRQpgfU69gUr9shaUmql3drr0
sMLs4+27FCqjsxhcGn21EiS4l5939USAhTLKKDA8TcUVGSX7Yld21ny/Yce8qwQDou9T5jgZMxt
6Hz5LWoTz2q0wxxJBtR9Vz72k/X320aeHZbFM5XGz6Ea1sVe3tOjrqy78Cy7AyHZ/nOpvYvsi93
cd/pgQtw+qHZguEjVgYakaxD4woQf3qjKfgq/SlRAQeypHOxgxp62m43MK28Ov+FWlDEm7vsdpC
cg0R7nhsip+2K9AE1bkv1k8cVrFGp5Wda2PS/vGtJIFvm6sbKjIXHTmGVWMHF4mK2y3TYHUcbPW
NbTtJq2qLV+AuSXDeZ9I7+z+K7wAIOpNUsA85BBvz1rtKb/pZIxIA6SQxWurox3ECACP+nXSpts
FlbenkE67GWghSICSk+rwYvvCdkhCiWbKlhED1dVGAiSWngvaYRtwqu/4jf+HYvtI8+hfJgs2D6
3GD0xnTPPFEL471oHSA+qVcyfNQVtdeDhpEM6/j1cTScBAi/lljMDyg7maPqIc7KeeV4Czynq1G
hHrGlX8SBpbYphZWeEWkxXEnAsc3kgryRHSpgLVEh7Oq
X-Received: by 2002:a05:7300:c00f:20b0:369:1401:c5c2 with SMTP id 5a478bee46e88-3751f561930mr3464316eec.26.1794316264028;
Tue, 10 Nov 2026 05:11:04 -0800 (PST)
X-Received: from [192.168.25.219] ([115.108.41.154])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3752060dc0csm8462471eec.14.2026.11.10.05.11.02
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Tue, 10 Nov 2026 05:11:03 -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-Cc: git@vger.kernel.org
X-In-Reply-To: <20261102-pks-odb-loose-cleanups-v1-1-fbbc86c29693@pks.im>