Article View: linux.kernel.git
Article #1570Re: [Outreachy PATCH] t1402: test --no-allow-onelevel option precedence
From: Junio C Hamano
Date: Mon, 26 Oct 2026 21:06
Date: Mon, 26 Oct 2026 21:06
55 lines
14671 bytes
14671 bytes
Fien Dora <fiendora5@gmail.com> writes: > Git allows later command-line options to override earlier ones. > Added tests to verify that --no-allow-onelevel overrides > --allow-onelevel and vice versa. There are many other commands that take --[no-]foo options and a later --no-foo overrides an earlier --foo (and vice versa), and most of them do use the parse_options() API. It probably is not worth our brain cycles to add tests to cover all these other commands to cover all these options that can be negated in a way similar to this patch does for the ones based on parse_options(). What makes check-ref-format somewhat special is that it does not use the parse_options() API to handle command line options, and instead uses a handcrafted loop to parse them. Covering the behaviour of the command with tests may therefore make a bit more sense than all the others. > This ensures that the expected behavior is preserved if the > argument-parsing code changes in the future. So I would say that we need two changes to the log message: * The rationale should highlight why check-ref-format is special and deserves to have this pretty common "no- prefix negates" behaviour tested (i.e., it is a handcrafted parse loop); and * We have immediate plan to rewrite the option parsing logic (i.e., not a vague "if we change it in the fiture"). to sell this change better. Thanks. > > Signed-off-by: Fien Dora <fiendora5@gmail.com> > --- > t/t1402-check-ref-format.sh | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh > index 9dd64662b2..6036df0210 100755 > --- a/t/t1402-check-ref-format.sh > +++ b/t/t1402-check-ref-format.sh > @@ -74,6 +74,8 @@ invalid_ref 'heads/foo*/bar*' --refspec-pattern > ref='foo' > invalid_ref "$ref" > valid_ref "$ref" --allow-onelevel > +invalid_ref "$ref" '--allow-onelevel --no-allow-onelevel' > +valid_ref "$ref" '--no-allow-onelevel --allow-onelevel' > invalid_ref "$ref" --refspec-pattern > valid_ref "$ref" '--refspec-pattern --allow-onelevel' > invalid_ref "$ref" --normalize
Technical Details
Message-ID:
<xmqqfqxsp3xb.fsf@gitster.g>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73393-linux-kernel-git=dewy.ruReferences:
<20261026132525.45414-1-fiendora5@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-73393-linux-kernel-git=dewy.ru
From: gitster@pobox.com (Junio C Hamano)
Newsgroups: linux.kernel.git
Subject: Re: [Outreachy PATCH] t1402: test --no-allow-onelevel option
precedence
Date: Mon, 26 Oct 2026 14:06:40 -0700
Organization: Usenet Network
Message-ID: <xmqqfqxsp3xb.fsf@gitster.g>
References: <20261026132525.45414-1-fiendora5@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
logging-data="1397950"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:TaV4tWmrL+7GdR58bvI1PLD8I5c= sha256:qCKtaoRL1qadRzStfE23vMw/4JdmbUu23o1a5RdXlzQ=
sha1:C+fsD3NfSAnIibd6vmPeX9iRxWs= sha256:A01z69Wt9svUB0XklYVZCRnguDy31+M1+8j9QaKP6VE=
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 24C67125BC2; Tue, 27 Oct 2026 00:10:37 +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, 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, URIBL_BLOCKED=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=UZPI41LE; dkim=pass (2048-bit key)
header.d=messagingengine.com header.b=U7nJ2aAl
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 zER1FTuQ32Sn;
Tue, 27 Oct 2026 00:10:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-73393-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 44F8B125BB8; Tue, 27 Oct 2026 00:10:20 +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 4340828252; Mon, 26 Oct 2026 21:06:44 +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=1793048804;
b=dnGtpJCDmjP686uqU1AJQmjJyz99yeAGezSgIqcpqb/61s8GI+X+FfOULG+nVkbIrLKk
rofl3mW3gYGtz63zVmdlC2UIri/BjzxVdKgLum5P6slYeYB3dHPonDs2d09MGaOHPcPDu
UqWQ6U2Qrai7NauSJg1YnW6B4l7QNwwVgSunx2U62aNc0KAbH/CadqagjXkdqrJcHpOYs
RFd10aiCO+cod3U+pSEYrT3MXdHOJL2LCgVidB9o40nTtRTn8ZUSCaBdHEOEdOg2SmeMV
/KlTj3IgQFh6wvK/be53C4sgkZeXMFRQZ9qq+yvVUZT2zIgDgTavJQvqTkxBjAV+nhQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793048804;
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;
bh=MuPP28nUUGRHZmk961Z2fCwb2Cc2aeW5s5UqTfH4G8c=;
b=BT6qR8xnspxSoYn3TawKepAN4QNIDhoZeLy+g9e6H+Q5n92JBjQxGRoZb8ohRXIBnWvl
ndICHyy0ThgcOdLXCELcKl9YOBtWKSalrGaYSbztdPsqSjqmPKyulva+57Zv6NbSbblhu
cIb8r7uDMoDvTotNpOaIqxWzzoXu8KwDNoqdqMPZhJebqZ6m/qqkVJVns0fpe2DV1BvXM
1OfrAnQeOQ1BS2mo+np8lbulLgiRdNxR0iOTfD5W+MrMOAJEhVP5WPpacS5CDVUva76B9
X+QR3MCcd6IZtYRQ0a1Po+YVg7UswT6w07xQLbpwmvnRnb8rp1AwwXMAIe0MUytNFgw==
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=fm1 header.b=UZPI41LE;
dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=U7nJ2aAl;
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 1B016606A322;
Mon, 26 Oct 2026 21:06:44 +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=fm1 header.b=UZPI41LE;
dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=U7nJ2aAl
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.149
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793048803;
b=LWxWypxdTAPH1dW1oLmsl6CFPqeuGLfWlud4GcL7FOQNAZSR6d07sap27WLmvgKqxj3e
+6FQLt+E67oEgyxM4Ueiu5pHJ8UsaXxWi+0+E7qyGc16IiHoQvwHrOtRG9ZJDAn9JoZsZ
v3Ylf8pQxKzD8NPEEdT/sZVuk3E8rUfj9PSQMOfeQju2EFjJ0t0cgBI0royrrFxnGex7J
VgWvphpEZF5pq4Buq2LogWeW+XYW+60mFlBcY/LfQja67MrNiWKIWj9Mp4zeqOSFbPiME
72cnxrHQLV7sevERCvRXaOrIFOY2QDRR6OkVamUFecpDsjgMIKfLxzrac3AMztKLrfw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793048803;
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;
bh=MuPP28nUUGRHZmk961Z2fCwb2Cc2aeW5s5UqTfH4G8c=;
b=W45tLlYrSd3GG4U/KJn270ToW+sj2l9Bci9kK0JoEzGkEXPKwMEor2Ke6mxrEeehaICv
gM7XTnlmYj9qwIzngQUTyXSvGMp9e0eh78HYF/28dkAI4gA88izsiym3UQeFgR9CmoKyo
wJnVv9Dt878fzp6l4vj7SXznXE3rPtpjUIOeKMFZKcNqXlEIXKfp1azW9XFhSRTZ/uW/b
zHrTH45+escdWnh0ZZuznmMht4BqTxdR+r34fVAGx79HjSWgi2InFvPDvwWXBdcHCnll7
q2tXZTqYerq5IhkMJ1ca8WX+R3kS2uQ+OOSIqWB5y8LStagBmhIrppweL/Rv9BSabiA==
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=fm1 header.b=UZPI41LE;
dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=U7nJ2aAl;
arc=none smtp.remote-ip=103.168.172.149
X-Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149])
(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 B1F8E606A31A
for <git@vger.kernel.org>; Mon, 26 Oct 2026 21:06:42 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B1F8E606A31A
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-06.internal (phl-compute-06.internal [10.202.2.46])
by mailfout.phl.internal (Postfix) with ESMTP id F3444EC0A49
for <git@vger.kernel.org>; Mon, 26 Oct 2026 17:06:41 -0400 (EDT)
X-Received: from phl-frontend-01 ([10.202.2.160])
by phl-compute-06.internal (MEProxy); Mon, 26 Oct 2026 17:06:41 -0400
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc
:cc: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=fm1; t=1793048801; x=1793135201; bh=MuPP28nUUG
RHZmk961Z2fCwb2Cc2aeW5s5UqTfH4G8c=; b=UZPI41LEen5Ll6XnUHGKdtGoOH
0KiicBiF4LQsJY/v+KF9zIBEN04V6NquXaXNvcjNx68MnZhctPckGGAGdvWtj77c
bAMLEcltBgZsTDQdvm/DRlhaCECN0qD1YmwPk9AsgP39v54COmgEcC58san3W+NM
7kkZykIft56HW0cCS5k1WaUYUUBbb0a7CysQt/2JzeH1jgJ0PMWYuVftQcvnIhcb
QBS0n+gzSfVLfQ8hQg81WCtDthsBq0dXpTjm+SV7FMxaqQaAss2hX3cfpw7RYrVZ
icqQwcTpFg4C9BSHqcHwqK10fS59QgZwIgPs4UBj4tpxaUh4qJMNZ6qftBmw==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:cc: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=fm2; t=
1793048801; x=1793135201; bh=MuPP28nUUGRHZmk961Z2fCwb2Cc2aeW5s5U
qTfH4G8c=; b=U7nJ2aAlDQZFdX3pdYjKgp3tJzkrr1LFqGe6cl3+1z1jUpa0zbp
tO86+BnB4TlimWBdNAVjsvkH2EYDPWjD4h/b/fL6HKjtvP5YO+x9DumBwjrRYK79
2Nz2DC+r2+eL6OKjJxI7R3JBd70Ni6AsZ9ZUFXDnokGStyUvN1E6wznkv47Uk2ZZ
o5ElPAkmz1d62jH23DXSrO6KntFj+BbXPerrEyEAFjEzlVmcV46Hkh2dB5+YwyiX
RlX+bTDTyjzxMWFJnPEgs8Z2EUauDOSrOOpMwiSUPWwn4vNSg528dPjvVaebQBtX
kxTTeU6NoOkt2WeDW1Pya/f08ulEtbtnjLg==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-07;
repo=github.com/dkim2wg/interop; date=2026-10-18; sw=lmtpprox;
action=sign d=pobox.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1793048801; d=pobox.com;
mf=PGdpdHN0ZXJAcG9ib3guY29tPg==;
rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
s=fm1:rsa-sha256:Swn0pPh4zW9F/pZ6Nxk5FRe5uoOTmQkoPuPKC1sQDXyNDnZ
uyhjBVp6dtiGt7OIckD8RC5HMC7s5C7zMUM85tN3Wz3Weh91FC7nFiqh8a1SUcuO
D7a7jaRDUxKHb84UG/ZYm41hQ0LOyC9dBa2ZQn1I/6ptO3M+yqjGvvhGVyEJgXg2
5egvCw854p5jsJvmlrJcQteuki8idTJKnn02w7pBd1yAqDqyFgKgITja+9NgCfp/
1apTJSOhLntwmsGWwflQ7911wqNrprnaWytM6Rtu+I+xHCw0aVQ6H7g2lV6sq/7A
KP6Sh3y+wZLJ0KsQjs4F5sUPOpCVEqjH7n+vnTg==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-07;
repo=github.com/dkim2wg/interop; date=2026-10-18; sw=lmtpprox;
action=mi-m=1; hc=12;
hn=cc,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:tPThROZjJbNg60ciL/Fm90VmJ/7bGd4EYBMsq8aHOHo=:8UKx0kTUGnLGXfy9lvzY9BfVoVkz+DWCiij3TAaWoVY=;
X-ME-Sender: <xms:4cDfavAJgf3bpB8WNWVtLiVqPuQJDS6qQPrTlARIaHwC9Zml4TA9bw>
<xme:4cDfapMckB9qY0lz6RI0z9rVcMn1hjxwgHfIBY592OG1QlOUmRdLgNi9EZW-CnS0j
HCUHiyxGJW4xR1JRqyt4PdlnsR0KNV-KrEEuX7qWlODHZkmk--L4IKD>
X-ME-Received: <xmr:4cDfakaXTwT5u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x:4cDfaknWB26iBJ47n9LCpS22h3EonfuV79uQ1pVYd7C7ic0AZXMzPygk>
X-Feedback-ID: if26b431b:Fastmail
X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
26 Oct 2026 17:06:41 -0400 (EDT)
X-Cc: git@vger.kernel.org, christian.couder@gmail.com,
siddharthasthana31@gmail.com, phillip.wood123@gmail.com
X-In-Reply-To: <20261026132525.45414-1-fiendora5@gmail.com> (Fien Dora's message
of "Mon, 26 Oct 2026 14:25:25 +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