Article View: linux.kernel.git
Article #2101Re: [PATCH v2] test-chmtime: use parse_options() to parse command-line flags
From: Cynthia Uche
Date: Mon, 02 Nov 2026 02:46
Date: Mon, 02 Nov 2026 02:46
36 lines
12195 bytes
12195 bytes
Hi Shashank,
I built v2 (43c96de13e) with NO_RUST=1 and compared it with a build
of the base commit (7e34d8174d). t0082 passes 3 of 3. Thanks for
taking Junio's three suggestions from v1.
> instead. Pass PARSE_OPT_KEEP_UNKNOWN_OPT so that negative relative time
> offsets (such as '-86400') are not rejected as unknown short options
> and remain in argv for timespec_arg() to parse.
No test covers this. With that argument set to 0, t0082 still passed
3 of 3, while "test-tool chmtime --get -86400 file" failed with
"unknown switch `8'" (exit 129). Could you add a test like this one?
It passes with v2 and fails without the flag:
test_expect_success 'negative offset is not taken as an option' '
test-tool chmtime =1000000000 file &&
test-tool chmtime --get -86400 file >actual &&
echo 999913600 >expect &&
test_cmp expect actual
'
Compared with the base build, I also saw three changes that the
commit message does not mention:
- "+0 --get f": base tried to stat "--get"; v2 accepts the flag
after the timespec and prints the mtime.
- "-g -v f": base tried to stat "-v" [and still printed the mtime]
and exited 0; v2 dies (exit 128).
- usage errors exit with 129 instead of 1.
Could you mention them in the commit message, or let me know if any
of them is not intended?
Cynthia
Technical Details
Message-ID:
<20261102024623.24897-1-herroyalpriestess@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-74100-linux-kernel-git=dewy.ruReferences:
<pull.2280.v2.git.1793350341743.gitgitgadget@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-74100-linux-kernel-git=dewy.ru
From: herroyalpriestess@gmail.com (Cynthia Uche)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2] test-chmtime: use parse_options() to parse command-line flags
Date: Mon, 2 Nov 2026 03:46:23 +0100
Organization: Usenet Network
Message-ID: <20261102024623.24897-1-herroyalpriestess@gmail.com>
References: <pull.2280.v2.git.1793350341743.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2831982"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:J7DJiJ4/BqBttaXe3nmOCcJoIDI= sha256:Egm6jG3c6MAcqzEGduMPIWPo391x6fq9atDZsLO1Y4c=
sha1:nlHrp2cFVvUfnBpLwaPK5JnS5X8= sha256:njJ9bpholsx3F0eJo39bOvYmeGvlp/chT21d74+/2GU=
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 B6381112404; Mon, 2 Nov 2026 05:47:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.452
X-Spam-Status: No, score=-0.452 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, RCVD_IN_SBL=2.596,
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 ruDnjGTogwaf;
Mon, 2 Nov 2026 05:47:39 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-74100-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 A61E91123F4; Mon, 2 Nov 2026 05:47:29 +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 BEBCA298AC; Mon, 2 Nov 2026 02:47:16 +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=1793587634;
b=CnxC8EiajJnCMwJYGTD6P9I6K1QO35ADW4RitfOCXo5gs2VCj53l9VeP7cuinZZtQTf/
x4sHtEtOMGuVyY21KCKEzud+yOSdJ0TjvhgHQa4NFOV/dOu0XZABlUZINgcmFMW/iU2+Q
ZZBuJ2r76XDzmu9R65Upow01yVAcvPQr2AkGfAmUq4eO+Ez7pl9xnAtOLzEv8L2cnOKKp
cn849ejpJa/9BVRAeLlRIkrYYvORPsYLDasLa7V67aGGDaSNsg1X/mXyS1ZXIicsxzENj
2j2KyNN8yD+IKyK69dFz5Zn7MPtEKQELocOT14twdt4Ijz6maJTBSHt5BXA30XByUxA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793587634;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted: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=S6iorwpD11vZyN56HSHDhl+z9mJ1tBBdCj/8O5mmVHw=;
b=V8a+agAa+kDJ4MC+gVc1WCxFOtf31EltTNuuMYvzXihQ4Ey7eJng2thBe/jedAgdfZdN
lTHUgzrwyjSMZJxIsycUZG5jQohBOPy860gp0ays0eUMy2wUJdUfJ2is4n3v59i560uOR
lmWNAKGKr0DZuKmbYCrkesWK1+T6yrmWxnY1smOkX/W6r4RkHH+OFZ7LAn4tobOaUR0d9
HRLk2GzFN3X8o+bol0tt6NWKpNgiHfqpvjersQqzx9J0GM88IsI0ZPr4znhrpglbdRxz/
QZwbIWPlzeBhQaYkNeA82e0SU1sYZlNtlDbbqU0CxOfpfWgQMTlT0CMuY44LvKsQ1pQ==
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=MLSy3Ckf;
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 75623606A32E;
Mon, 2 Nov 2026 02:47:14 +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=20260707 header.b=MLSy3Ckf
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.43
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793587633;
b=f+VY6YfTjwKX4Zcv/y2JmHgvyBaV/p7f1T1vomxQdjb4ww4VRFt8L5wVIxaiE0SIJTDe
q/MepR1MLfhJG56CT5QtWrcm98gpiZZq7NRmaReUH4XruEObdEiqf7GwCt45psPYyLuMZ
UGJrz3Kxn/E021Slfb6g8068hGWZs9okVyVxlkPDugAc7fAuxj+G9SXTy4KG6n9xLLTlx
x9HHBS18LNwY076m+/Cl9vAB0rdtPj+ZBtsNvE7GZUVVAXqiYm6EYwSW0DBK/4blso7A6
JrBe96G9aP9ngwYXZuy0Tc7QJnyb7taPtlUSAVuQSmqy7FoexPqU6M95lFI2TCnpWSQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793587633;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted: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=S6iorwpD11vZyN56HSHDhl+z9mJ1tBBdCj/8O5mmVHw=;
b=wMEWG7zqbrfDQHmcdi6jo+ZsS70DIBK2PJtdnI4H2G08TmYt2nR77Oj4cjdwW29rVAte
6zaPLYJSkfqlfdvnpKEs0C883TjB03HJ8Arn3MuVdWe8/EJCkfrPLQhrWR1rgRVwfDOh4
dx+FX1rmm5zVSE5scCw0RFMXfU9vUwQ88SxVTXK0IIrcoc8O7evm9aRRMeL3WZrmYgqyq
dT2BnUGHJQ+zJu9qDCDjhiO8cwaHqE6XkOfQPdfopR3HwDT7bH2ZfdM7+cKxWUFVslqwG
17flD5QmfO4ja+7EmUbQqzbFARNeuRkxLlj9GFm4ph6sX9jsj7LYzhVkxleJ1POKOAA==
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=MLSy3Ckf;
arc=none smtp.remote-ip=209.85.221.43
X-Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43])
(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 3C357606A324
for <git@vger.kernel.org>; Mon, 2 Nov 2026 02:47:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C357606A324
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-f43.google.com with SMTP id ffacd0b85a97d-48e3b22e971so1177141f8f.0
for <git@vger.kernel.org>; Sun, 01 Nov 2026 18:47:13 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793587631; x=1794192431; 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=S6iorwpD11vZyN56HSHDhl+z9mJ1tBBdCj/8O5mmVHw=;
b=MLSy3CkfsykFgXw38eLfo0ZOj2uekWF9PvZfnktNQ/TpJz9iipjXQWOdiet+9jYhJj
7XoXQY/UNt7x1I52hKlGjX+vdh/g0A75RTIXN0X31nJTfZAje+8nDOdlI1WauPfbrnmt
vUST7eFFwU+UUlUc2piayvYTCXFgZxpWRLHdo4pFAPkSIFMYSStIzCBg3QX/vV9I4ASy
YM8NNXiHxKTymXr+h5m29ioL6cZDOfRdB1NDt6tUbQlKOw5wHfhTuu1Ld9ApWpSfiOli
6dPai4QHNybXEgOXCFirYsgj526qFmM7F5guUrpxJ1mBAPHUslnYA7r7hMYGGt2UHYQD
BQaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793587631; x=1794192431;
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-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5VUFZSTrfvUSmAuOs7joR87jgm84T
G2ZOhW8QrIuvzpnRy5zEw5ef7MYMrtBzWiS5x6MDqyReCeNEVBhj7D2yra6OvUMo2Hm3nadQHvW
Os1TUiRiqvJyuH6y/qxuHuvnbD9HfjXJOaNjLJQ4s61Kqtckdy/iCkj2MF/wSEDGAAargacJTo3
Khc4kU65IiDBtvSD/8UO+/kDIzfoLELqML9q9KKn7GtVegYdfEUb06yxAxisgkxVezqQeDb5mw=
=
X-Received: by 2002:a05:600c:638f:b0:4a3:59c2:b41e with SMTP id 5b1f17b1804b1-4ac150b304cmr202640605e9.4.1793587631463;
Sun, 01 Nov 2026 18:47:11 -0800 (PST)
X-Received: from GODS-GIFT.localdomain ([197.211.58.221])
by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4aa80f04785sm312585265e9.4.2026.11.01.18.47.08
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 01 Nov 2026 18:47:11 -0800 (PST)
X-Cc: christian.couder@gmail.com,
git@vger.kernel.org,
gitster@pobox.com,
kaartic.sivaraam@gmail.com,
gitgitgadget@gmail.com,
siddharthasthana31@gmail.com,
usmanakinyemi202@gmail.com
X-Mailer: git-send-email 2.56.GIT
X-In-Reply-To: <pull.2280.v2.git.1793350341743.gitgitgadget@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