Article View: linux.kernel.git
Article #1250Re: [PATCH v2] init: show absolute path of (re)initialized repository
From: "Matt Hunter"
Date: Fri, 23 Oct 2026 12:21
Date: Fri, 23 Oct 2026 12:21
40 lines
9328 bytes
9328 bytes
On Fri Oct 23, 2026 at 2:26 AM EDT, Patrick Steinhardt wrote:
> On Thu, Oct 22, 2026 at 08:06:32AM -0400, Matt Hunter wrote:
>>
>> +test_expect_success 'init shows absolute path to gitdir' '
>> + expect="$(pwd)/init-path" &&
>
> I don't think this extra variable buys us anything, so I'd just drop it.
>
>> + git init init-path >actual &&
>> + test_grep "$expect" actual
>> +'
>
> I would have tested for the whole message, which is short enough to be
> reasonable, I'd say.
I considered this. I decided on this simpler version since there are
4 possible messages that could appear at the end of git init. Do we
want separate tests/assertions to check all outputs
"Reinitialized existing shared Git repository in %s%s"
"Reinitialized existing Git repository in %s%s"
"Initialized empty shared Git repository in %s%s"
"Initialized empty Git repository in %s%s"
are as expected?
Furthermore, the final path element is configurable as well, though
should just be ".git" in the case of these tests. I figured, since the
actual breakage was about the appearance of the path, then I would just
test _that aspect_ of the output in this test.
How do we feel about this assertion
echo "Initialized empty Git repository in $(pwd)/init-path/.git/" >expect
test_cmp expect actual
which tests the whole message of just the default case? The unnecessary
variable you point out above is repurposed into a needed tmp file.
Technical Details
Message-ID:
<DMC7P4CPEV2X.25XRRSBEZCFPH@lfurio.us>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72986-linux-kernel-git=dewy.ruReferences:
<20261020053932.1274210-1-m@lfurio.us> <20261022120749.3567828-1-m@lfurio.us> <atr-Juww5KZN-ugM@pks.im>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-72986-linux-kernel-git=dewy.ru
From: m@lfurio.us ("Matt Hunter")
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2] init: show absolute path of (re)initialized
repository
Date: Fri, 23 Oct 2026 08:21:11 -0400
Organization: Usenet Network
Message-ID: <DMC7P4CPEV2X.25XRRSBEZCFPH@lfurio.us>
References: <20261020053932.1274210-1-m@lfurio.us>
<20261022120749.3567828-1-m@lfurio.us> <atr-Juww5KZN-ugM@pks.im>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="495003"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:qs97onsCbXR0gUYmwAUpCL353Ws= sha256:CtfgIFqlqWaqusTuK5ycHgJe2eKrHkBaDGBPlgIbsi0=
sha1:PJ7r+wGQ/aH+Y9v7cNy7JTqc80U= sha256:1IDN7w7cnVB6W+8zZQeisACca1hd5NbJThxo6XzgMnw=
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 4687811149C; Fri, 23 Oct 2026 15:23:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
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 (1024-bit key)
header.d=lfurio.us
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 k1UqY0wn58Sn;
Fri, 23 Oct 2026 15:23:38 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=git+bounces-72986-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lfurio.us
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id 53E8C111489; Fri, 23 Oct 2026 15:23:30 +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 DFB3A6048FB; Fri, 23 Oct 2026 12:21: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=1792758091;
b=K3DprxUG8MV08cxUVdV2Zs0q2tV9jLeCREZED3nKi4+CeO7dVM0uwwhELC6WReLOllXS
RaUbvqR2SWod7fJKIBT7fSuh3lv4VgmfZ3A6Z1nUB9nwhz4rStDm4NAdzZWtvcsj1A+Du
YTwkk35U806kVa/fwiQ7tmjIGbYGSvOsT9C9irHv8k8pRSL6nX7CkKbNRTRknGJzgtkBY
OdcBKE9w1JFXy6DvIBWNUvS0d89A9P8VfkRPzRG+jXTieVDw0T96sPsDG+gA08QTjOQwm
P5QoKX0IT7wbcqG1RDFd7UihGRaLc3YUblDmHNSrJOlNOYTAOFycJmuSTs4NqB/pMjw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792758091;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Subject:Cc:To:
From:X-Mailer:References:In-Reply-To;
bh=mk2u/ZGaowZeKPAg+cn8K563+dbCXDW1DvbT3fsdTkQ=;
b=Zc5jso0N8bjnXCdwXoeHJdJsVg5aOZWE6toamxPgisMuIqGpcKIZck9cGkbVYmjn40j2
jlAFqn2IZBiLyWBhBQ6MQCy49GbeyxeOhWBWRlj6KX/6twrPSmnHLoKGYsxrWpnS4fnee
X6lWJ6l2Zy1y7yLq7yHgTt9j95Y7m77BxCuxZQ2XEpM4sg19UHps+WZWztzVfpLhi2F1y
59+uItgm3heTyc08oBzEskESzP+wMr7CWlMu7OgMqQAEqFo+4yepiQ0S/nNwlbxbcTo9p
2XmK8AvXLAbhLnbgTA5S7YDSZZfVIESF1nsi1H14/HaOKQUyeyFyEEORQKyUdc+/U4w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b=HADmxrY1;
dmarc=pass header.from=lfurio.us;
spf=pass smtp.mailfrom=lfurio.us;
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 D609C606A323;
Fri, 23 Oct 2026 12:21:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key, unprotected) header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b=HADmxrY1
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=157.230.60.252
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792758091;
b=IYxB32WqRnT/SD0MmbLVie0R2yuAKgQqTWUVtW7EDH9zugS3AUqVk9CBzskb0qvKmEnK
M+wL5R4ke3k9gyVZixdNsGd7FAYaz2eGfo70espR+dcASRiXc/mw9/ZusAuBVqyjllcBy
Jy6746nzBzRyj/NkJhA//rpO4/rjcDQ5EJzk8Z0MURqrceAkg2aPctIw9EN+d/eWok2em
BZppeA2mkL6dzzy8Ikg3fzCm8xZxBuHok+DYKmNHssYM4GQEivFwj5IhENZqdIalBI02Y
IdhViWnOslk3p4sq5LxOenr09n3LgvMOv5HSrchQDzdrDKGizBl9wZI25aEYVFosRFg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792758091;
h=DMARC-Filter:DKIM-Signature:Received:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Subject:Cc:To:
From:X-Mailer:References:In-Reply-To;
bh=mk2u/ZGaowZeKPAg+cn8K563+dbCXDW1DvbT3fsdTkQ=;
b=r9OTUJXbI13XxSzqIstC81maQ1EkHfRkWIUweAFFXe7Tb/5SPJWZiHzqexndn3kjJlzq
me6CEzSd6YhI09lDoFS0/DHvVvIRexXM3cqKhcsxPH6mSB/775o1WM/o/kmnxz1dj8Z8u
GS+WxSfh3tAb5xj/yrdCOEOCp631Lqxr3UqZtLwAmuHNAr0DC9Oa2BrplU7Dgib7tG+Hp
grO2KIFpM2mzooPeyyO+agbsGXhvBRo8iVqlmbwSEqI+a5GuL7xB5oGSUzCyBX2S9Unyv
E5jdURZzzRKGp3W+KnkRyqV3//iyt66MNfFP6iJfmkZSMLQmu1QNHT/IAy89RTyU5Mw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=lfurio.us;
spf=pass smtp.mailfrom=lfurio.us;
dkim=pass header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b=HADmxrY1;
arc=none smtp.remote-ip=157.230.60.252
X-Received: from mail.normalmode.org (h01.normalmode.org [157.230.60.252])
(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 57C38606A31A
for <git@vger.kernel.org>; Fri, 23 Oct 2026 12:21:30 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 57C38606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lfurio.us
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lfurio.us
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lfurio.us; s=default;
t=1792758082; bh=OmHwsRvXMM7Jx3hcdmguDqJIpJU9NBetwoBSIhAywJ4=;
h=Date:Subject:Cc:To:From:References:In-Reply-To:From;
b=HADmxrY1SFuWbf6TXrCrHBr1rt7gLzuGaPGBeIbsBMxKffrTqxEEBAh/a7oQr7PUt
RQZsO7H5ZqGhfwPtGhCxwepuAcPunkE+g3YcO1o2o7tjU+WUPwHlWWMeaBD1Ef48Cf
gYn4JzmWekY6ioOQ48fUYtBgVD/dFbAsH6WB0pT0=
X-Received: by mail.normalmode.org (Postfix) with ESMTPSA id AFD9B62AB0;
Fri, 23 Oct 2026 12:21:22 +0000 (UTC)
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-Cc: <git@vger.kernel.org>, "Harald Nordgren" <haraldnordgren@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>
X-Mailer: aerc 0.21.0-0-g5549850facc2
X-In-Reply-To: <atr-Juww5KZN-ugM@pks.im>