Article View: linux.kernel.git
Article #4054Re: [PATCH] archive: pass export-subst attribute value as parameter
From: Junio C Hamano
Date: Sat, 28 Nov 2026 22:38
Date: Sat, 28 Nov 2026 22:38
43 lines
14728 bytes
14728 bytes
René Scharfe <l.s.r@web.de> writes: > The member "convert" of struct archiver_args is used to pass the value > of blob attribute export-subst to object_file_to_archive(). That's an > unusual place and a misleading name. Add and use an appropriately named > parameter to that function instead. > > Signed-off-by: René Scharfe <l.s.r@web.de> > --- > archive.c | 12 +++++++----- > archive.h | 1 - > 2 files changed, 7 insertions(+), 6 deletions(-) The name is misleading indeed. Why it is "an unusual place" needs a bit of explanation to convince others, I am afraid, so let me try to spell out the reason why, as I understand it, and see if that matches yours (and if so, "an unusual place" above may want to be strengthened by the reason why). There are two ways this function and write_entry() (and possibly others) receive settings from their caller, write_archive_entry(). The archiver_args structure is meant to hold the settings common across different entries to be written. In addition, per-call parameters give information specific to each entry being written by a particular call, like the path of the entry and its file mode. The 'export_subst' setting is per path and specified via attributes, so it definitely is not common across entries. It does not belong there, and making it a parameter passed to object_file_to_archive() moves it to the right place. And with a more correct name, which is very nice ;-) Now, are there members other than '.convert' in the archiver_args that should be moved out of there for the same reason? The '.convert' member needs to be reset in write_archive_entry() for each and every path because of this misplacement. If there is no longer any member that is not common across entries, perhaps many of the consumers of 'struct archiver_args *' can take a const pointer, most notably the write_archive_entry() function? It needs to propagate the constness down to write_entry(), and is better left outside this patch, perhaps. The patch of looks good to me. Thanks.
Technical Details
Message-ID:
<xmqqv75gtwdq.fsf@gitster.g>Path:
mbox-mo1.pugleaf.net!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-76608-linux-kernel-git=dewy.ruReferences:
<6c09fc91-b461-451d-90d6-512a4f785d8a@web.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!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-76608-linux-kernel-git=dewy.ru
From: gitster@pobox.com (Junio C Hamano)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] archive: pass export-subst attribute value as parameter
Date: Sat, 28 Nov 2026 14:38:09 -0800
Organization: Usenet Network
Message-ID: <xmqqv75gtwdq.fsf@gitster.g>
References: <6c09fc91-b461-451d-90d6-512a4f785d8a@web.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1048782"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:fc/HMVjk1KnyWeuMwPMhB3YGMq0= sha256:lWeeEVyZrvam1SZx3/T1g5E+16xWRHpMe5Yu62kIgTU=
sha1:X8acB1tghm+IYu14tOnZmMBMGK4= sha256:jICrUfBVnkUhCzDNeefXPwua8E6OBseZgztXU91+jMw=
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 1E913125F8D; Sun, 29 Nov 2026 01:38:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.951
X-Spam-Status: No, score=-1.951 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,
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=pobox.com header.b=TlN+yw52; dkim=pass (2048-bit key)
header.d=messagingengine.com header.b=oDMfdH+A
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 1ymi5NI62yHl;
Sun, 29 Nov 2026 01:38:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76608-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=pobox.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id C58DC125F8C; Sun, 29 Nov 2026 01:38:15 +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 2117F231CA; Sat, 28 Nov 2026 22:38:14 +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=1795905493;
b=V1vH3CuLiIsd+gEteh65lAsLpBPCuRhAZL5Pw05zNZi1Qk0ABvYm460KornG5VeOEUmL
+mbVH9wLwb2MKmGup2EXDI54rq+brYsnwoiWu3WJfAZ7OFXMBz44bC94UPTo4RkCZBtEC
dPr304rR+wz6QzIzRErMa9ivx0W8KHUlPlrn+Z6KnOgnAa+xkG6++HWNQuza314kDkFFN
kU5T+9s4e0Fmzy4qKt1b+WRfZWOrb2uNP0sWrOodPSSVoXhLIsJEGgBq1AYB4wqq8F5EV
zOr7z1LNrfxmZUcoe3x8k3ZYlZF5Pgm82JsvHMjYMrpEOsAJ2k/DC2DTLJn+xXfAzkA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795905493;
h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature:
DKIM-Signature:X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:
Message-Instance:X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:
X-ME-Proxy:Feedback-ID:Received:From:To:Cc:Subject:In-Reply-To:
References:Date:Message-ID:User-Agent:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding;
bh=ykF7uneJ7bcrLJfW/IiTJliu4rbao6Y9y7OOKM5VfIo=;
b=c4CPVq0b0m3UcON4JcLTVzPILWh0LwFf3lYidHESjRdQvrHgPJGDgAgWSkCH2fu3D4V3
3zPY2s1vV1sMTY3cplUer3/nk+FMaviMCEgQ9vtM0IWd16/rztRELTCbVomV1SPXexDpK
ldUHbB61HWYvGMxaauEKqcU8GF0Id+yOHQ6bTXDivl6domzZGcmEEVYMffcALeucWH/Is
eMniMyND8X4Hj7B5yfJMToTzTvjHLJfRhDtWUHhnjhm1PL1/RDR7/t/WZbkrZgOc00KKc
LBJ6YNX1eYGILKHZ6Akk5bIGSFC/iRp9cJod/frlKzkVYiZKeds4ljfF6A2wAh0DBsQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=TlN+yw52;
dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=oDMfdH+A;
dmarc=pass header.from=pobox.com;
spf=pass smtp.mailfrom=pobox.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 3A06C606A327;
Sat, 28 Nov 2026 22:38:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=TlN+yw52;
dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=oDMfdH+A
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.148
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795905492;
b=QqMweltFwuptKP+D+Dg3Gr1R3ZR77ukTuNZwHHzPAz5VDK1DkuTnEsaCS3nKg2OdOBgw
vZbpYe3KL7A+I1rTpSOJX4Q5jRdLWA646Y+tPoHdk4LCdux1uCleKafqFyqhNpsogP5qd
75ywJKQsRq0YVhajo2ovZBSPDhnGYW2yznWUl4oM+HRfDBgALxDRUZiTrpLjQSumMfABI
1XK7ju8r6z7ejdDz/WIxKe8J5zrysUCsaJ2A74jEMgu85uG/wnusSoDzVuH82ucHRdJXz
Mo/2pPRdP/H42sVj7M7W6fZHXBRC5FHiiPgjXErFZWK6aBoIdngoDfYbDVWntBhk+Nw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795905492;
h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature:
X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance:
X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:
Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding;
bh=ykF7uneJ7bcrLJfW/IiTJliu4rbao6Y9y7OOKM5VfIo=;
b=dF6WkEPgaWwQfSe2hQ5T1F3kNG/pM+DpwnOE6iqekxg6xcjvrryj43YJtTbIVC6fX9+H
R/cA3ZhslvKtoRGKb81A7sIcOWX5n0DnnbzXSyUpaHvDLtSdhYlh13e4OcTa9LYoKXe4P
15cjk9AbuRvdttk/Mbejg+jUxygKUV3CzbI1qXfndf1d4KsxIwHmDWAdgwbOESPHD5kjv
zmCbr2FVQeggmcBfd4jp9NZHkRFH8tLNvKM+0QQxOlUyQp9kCikDLulL8iqQIOYsB9D4L
nIt5A09m05+lIwhcVzVmdEx5gSrqiWdF/ntWp/kGpYxz0mPoVmnA2KDFxFRRP2El6dg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=pobox.com;
spf=pass smtp.mailfrom=pobox.com;
dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=TlN+yw52;
dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=oDMfdH+A;
arc=none smtp.remote-ip=103.168.172.148
X-Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6AAA606A31C
for <git@vger.kernel.org>; Sat, 28 Nov 2026 22:38:11 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D6AAA606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com
X-Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41])
by mailfout.phl.internal (Postfix) with ESMTP id 0B033EC0A08
for <git@vger.kernel.org>; Sat, 28 Nov 2026 17:38:11 -0500 (EST)
X-Received: from phl-frontend-01 ([10.202.2.160])
by phl-compute-01.internal (MEProxy); Sat, 28 Nov 2026 17:38:11 -0500
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc
:cc:content-transfer-encoding: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=1795905491;
x=1795991891; bh=ykF7uneJ7bcrLJfW/IiTJliu4rbao6Y9y7OOKM5VfIo=; b=
TlN+yw52/kOFJx0pkNGg6PWaRMo+cDMCcxwmHNc4vZYcM2CG0mZ1xYtmjXQJrYCg
nCUYcSv6pm3XOyB+ieaTAyr6atZ9JGbWC6TINIPlr+Vl2FBTeizN+U2SswiFoNwc
0Fyx0juUAqt5TW/5H4NhzU7ndcpEBBwwVfnfxyAjWf/xHmwfVOoomX7Ged+W81F3
bGZgz8GDUOQYwYOY2wjMGxWPkUKEqHhHIabfhix5p2cJ1L4zUHB81Whd9ZpjnHkf
VW8uGBGyUgKJVGtTr+jw0kibLQifAfHemo2wUv51gqhfFtCHjt7x+gs3P4+jXwa+
u/oz7FgCJJQjNcfzduJuiA==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:cc:content-transfer-encoding
: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=1795905491; x=
1795991891; bh=ykF7uneJ7bcrLJfW/IiTJliu4rbao6Y9y7OOKM5VfIo=; b=o
DMfdH+A7l6Ke/72iLQIyhqOa5swtM6yjnZMh53QYkFmhw3jsZZHQFkOQyaTPPUj4
VKnuOcPh/B6JMk8ZP0IocNRcsM7rLWTl8jelE9KuVuS2KSdFdpnV6mplnkXyMsvg
BbTCVPH4OB4ekxDdE+YAPjoVUqU5Csj+vppX52/SSSkpkTjsMffGU1n9+ZQqaOX+
4DDxqAg9pXW6X1q+rTQKISFEMYnS52+qylld9ofuhBFOphUL+YcQ8dNilr61VuDN
GmVijNthdJGzAkH8551whBv7tL7povp22OaPtIwmOAJ1R+XmgUxzXlydUl5XENMC
HrTO69HtMEAC4M/D/CtNw==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox;
action=sign d=pobox.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1795905491; d=pobox.com;
mf=PGdpdHN0ZXJAcG9ib3guY29tPg==;
rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
s=fm2:rsa-sha256:DpV8NcRddoqb5lPCNeuupsk2O/GjySg3bbjHEuaM+JDAeSm
AWRVfOZkC2H9Ii+QQZcJL5Hsk2icgTn3U/hYQmbK7GXQH4kC+EQUXkmYwJLSMPfc
tGeCDrHNxgGbqXQ3XxEUEmncfJRt5ha2kSl24NUV5Nvz1GCr8IG9xubdzSBk4nrY
BQGAOOW43d/3iry2PJmdJwrrL0GmXE4LlLNPwSGsxMKrFzDaQgUDlqNyTGB/epk7
tKkzCEeTwwew0UQXKGCjpC2VepLCHBAMIBZvqO6rzeXPEKIz528RcJi8eWJeAsb9
UTNLMOpENjyCHWIXTgqQf+NpRtm+cjWFrgCSO/A==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox;
action=mi-m=1; hc=13;
hn=cc,content-transfer-encoding,content-type,date,feedback-id,
from,in-reply-to,message-id,mime-version,references,subject,to,
user-agent;
X-Message-Instance: m=1; h=sha256:nwNpmB9L5C1MiDHUuKfZeibiFatym9hDsBw/4/IFicU=:Ef+Uas4PWwv598aywVkRhtgpUsabb9Y6xErHpRc7Yfc=;
X-ME-Sender: <xms:0lcLaz8lyFRbEKDBtmr7aka1CLHwe3aoxcd2yHNVR4Stpvbz8n90rg>
<xme:0lcLa3JtlJQUSpwBL_tWfCViYLWJhiXuMnSjki0I4rP5x3EfCgDfsiTFw6PBddkX4
eD44tFKhVeXiM0l23Ruuvn0sl5p2EV1kywU4xw3WTydM8G5Lya7Zw>
X-ME-Received: <xmr:0lcLa-YNHZOZNYe220ZzRxWjSPRaSr6wmumbk8PdEk-D0kfBcAS4gpSKeUxBigwQES1l5zATNowCCwkNwftUK0GYz53TT7AyMs5NgC0>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fix) with ESMTPA; Sat,
28 Nov 2026 17:38:10 -0500 (EST)
X-Cc: Git List <git@vger.kernel.org>
X-In-Reply-To: <6c09fc91-b461-451d-90d6-512a4f785d8a@web.de> ("René Scharfe"'s
message of "Sat, 28 Nov 2026 19:47:49 +0100")
X-User-Agent: Gnus/5.13 (Gnus v5.13)
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