Article View: linux.kernel.git
Article #2676Re: [PATCH v2] check-ref-format: use parse-options API
From: Hussain Sitamouwala
Date: Mon, 09 Nov 2026 07:43
Date: Mon, 09 Nov 2026 07:43
54 lines
12635 bytes
12635 bytes
Karthik Nayak <karthik.188@gmail.com> writes: > Seems like Junio's review went unanswered. Which makes it hard for me > to consider dedicating time to do another review of the newer version. Hi Karthik, Junio, Sorry about that. I sent v2 before replying to Junio's review of v1, and I should have discussed it first. I have now re-read Documentation/SubmittingPatches and MyFirstContribution, and I will wait for feedback before sending any further version. > What is this change about? More importantly, is it sensible to have > this and ... another variable with very similar and confusing name You are right, keeping two usage variables in sync made no sense. v2 has a single builtin_check_ref_format_usage[] array, and usage_with_options() is used for the error path, so the old string is gone. > As can be seen in the usage string ... we still accept "--print" as > a deprecated synonym but we do not advertise it. In v2, --print is marked PARSE_OPT_HIDDEN and its help text says it is a deprecated synonym for --normalize. > Do we want to barf when the user says > > $ git check-ref-format --no-print --no-normalize > --no-refspec-pattern ... No. v2 adds PARSE_OPT_NONEG to --normalize, --print and --refspec-pattern. Only --no-allow-onelevel is still accepted, as before, so the set of accepted options is unchanged. > The call to show_usage_if_asked() is still here, which means > "git check-ref-format -h" is intercepted ... v2 drops that call, so "-h" now goes through parse_options() and the option list is generated from the table. I also used PARSE_OPT_STOP_AT_NON_OPTION so that options placed after <refname> are still rejected, as they were before. Two behavior differences come with parse_options(), both mentioned in the commit message: unambiguous abbreviations such as --norm are now accepted, and "--" may now precede <refname>. If either is unwanted, I am happy to change it. I ran t1402-check-ref-format.sh and it passes. I will wait for further comments before preparing v3. Thanks, Hussain Sitamouwala
Technical Details
Message-ID:
<20261109074352.163019-1-husainsitamuwala21@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-74871-linux-kernel-git=dewy.ruReferences:
<CAOLa=ZS3ULcNVjV1DMO-iB+LcC2Gnw+9oU2_7VXKoLvgiVRnbg@mail.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-74871-linux-kernel-git=dewy.ru
From: husainsitamuwala21@gmail.com (Hussain Sitamouwala)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2] check-ref-format: use parse-options API
Date: Mon, 9 Nov 2026 07:43:52 +0000
Organization: Usenet Network
Message-ID: <20261109074352.163019-1-husainsitamuwala21@gmail.com>
References: <CAOLa=ZS3ULcNVjV1DMO-iB+LcC2Gnw+9oU2_7VXKoLvgiVRnbg@mail.gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="300262"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:5PpJCq8qE5R8EmFUay6etTbp1OM= sha256:NEdMRUFjwN0kPL54eUNMmFpy/tPsoZB4eC9ckH/nY2A=
sha1:5r4vmzs+9QR4Rbtgwoyn7cqwHy0= sha256:rT9JLR+6mBIEtmI+xPg4yURnBifCzrLotXNhnKlej04=
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 34A1B113712; Mon, 9 Nov 2026 10:44:28 +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 hShpp3aevtxL;
Mon, 9 Nov 2026 10:44:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=git+bounces-74871-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id 5B6DE1136D9; Mon, 9 Nov 2026 10:44:14 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id B198C2AB58; Mon, 9 Nov 2026 07:44:08 +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=1794210245;
b=yfwxBtW0w7ft4TYQYp2bUVHCxhAml7ZkM0zrgLITwqIsQOmTxyr2315vjXD3EwQFz1jn
apdTMyAT13/bLQuqLQg+XnCqDP4YXycveCV3yyYfiSKMRwD9qLhtDjHMAk8/elSCNbPpB
BfnbYIrAg6NZZmKqI5LbuP7U5eufRXikw+nC3FA/+baa+3d1updyqewMygaBkkFv1ZCby
Srs8v0gD9SaxvvocdkP2Ujr4Yk6B1QWnw6mSE0gy4eujzpJIxpG3ekE+gtDbkRy2rQ942
ruT90BQgePnsHRA0Bq3PdQpUH2s8XAYCcVe8dyAEHY1ampEpLCx59fBFKQ9JQ4Nkf9g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794210245;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature: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=v/dZ4WCHOPZwVhwaqakE0J9NIPodXOg4lBCFy0ePPM8=;
b=z9Xo1FfiVP/SOtKsdc3+7aaneEWSxuMXpbgoN2Ffutp9yyyEAJ8gdPYJXfv09CWPU2Mw
Y+BidGff5S2vo10CZfizLUlScAKJdHkN129PgP174ZGnwzeSSFrFVR69bUqlgCeRb4RA7
77wH6qf3OrwQk+Y4oDxI7JmnvBZCsCRFnQn5pFgzuB+g76GwSP0TsCLVcEZtD5RSjQCgS
QRcfM2w4JRi2W7m6n6wV4yIXeXYUTbBF0ygtY7pye12Wdc3LrnS6bRI4VE0kzbXiLL0Yd
OERbKtDQHogwhrL4UElgDfWWGhtf7bXEMX/S0XwnUy/X8K+K4LeWKtZjHG1PPYY9Xjg==
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=urBJM79Y;
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 B6EC3606A32A;
Mon, 9 Nov 2026 07:44:05 +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=urBJM79Y
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.170
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794210244;
b=JG9r3lQ/Em7Pd3/eGbu833xQ4du4lNkrfnXeu2z9Fw6xoxI4rA8pMsfXSso3b1SRM87R
uz68CVUdZY3soUf0nDI3Nq6p4p7zR1/B0FbrWt8+r+jD2PI71mWtHUVftOqnqpBx15m8p
nAHDBRghPA3zOMLp1s+XtfJQClXAemkQa2/ovxt0Ti03e5uwNEz6QFlngAETF3CNer1SX
D5lND4mmMmUd00hrCYHiazsrsJ51Wk1nhMBfmRaYpD/JYAalKaRGA5lhHIXUZDYZICF0d
nyu/PHwCdSEiirsJp0mA2cD7UhVOK1VeNZmdgv5AwuzzzpwtycqGNAlP/gP7zl3j//Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794210244;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
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=v/dZ4WCHOPZwVhwaqakE0J9NIPodXOg4lBCFy0ePPM8=;
b=h3jOttjSnatX0drpSRVIpx6Tu1IiQZn/Se3cI28DpOB8/m93hC5YYIQJozQ/BAq8Iyvv
1EBQx4GmdUkZNA1Uhaf+4JbeSuq/QL0NeqLLMzKQwppyAvcd+QdbsCckfp2HVNLVyI4v4
PM1CYDUHiFZXQYjlgLAGJOcvAIme8yTD51i7equR1PGindlnpY9MH8yJwhPZ0jjYhust/
f8ZOlyXt333ldVoBDwUylsMjM/78KehSphwIbhn2455l49yw58FzoDiHDtTtv2MIBIxe0
qotAKgnzLiFr+CyGq8Q/oOPBCmlC6rdWTQHjfWTPFEYNuQ6cLYyLvtLFbWNMjSvHHTw==
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=urBJM79Y;
arc=none smtp.remote-ip=74.125.82.170
X-Received: from mail-dy1-f170.google.com (mail-dy1-f170.google.com [74.125.82.170])
(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 85084606A31C
for <git@vger.kernel.org>; Mon, 9 Nov 2026 07:44:04 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 85084606A31C
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-f170.google.com with SMTP id 5a478bee46e88-36fc0a3fe93so1197856eec.0
for <git@vger.kernel.org>; Sun, 08 Nov 2026 23:44:04 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794210244; x=1794815044; 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=v/dZ4WCHOPZwVhwaqakE0J9NIPodXOg4lBCFy0ePPM8=;
b=urBJM79YRDDgLqCYEAsjslmN35Ldnz7br/ZPNiI/DHbZ8kP3+5J3luynnFWXYPCc30
CQBWpuy+fs5Jn83ajgg9RlymjbViW2mfY4D2a8kZlKbvuEiNNJ4VhWgI4ffGivfXB57J
qh4x71kfKeK0jYIZ/k5OawTIqDeThVwVoqIEI2osaL3uiC9IXdsXkORURfLwmTQyu3z6
FYsbYh6uE25wpa+M6kc7sc6LoUNwhppfCHJkFXRDkHnhczky7Umm/BhqbLb5shABZBI5
IXVSbmM/Jh5oT27O2q3jUUZLXUfUkC4537eSz0+ozaO/0LqqWb2QQm1NiEFZL7o3n26r
xccw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794210244; x=1794815044;
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-id:reply-to:content-type;
bh=v/dZ4WCHOPZwVhwaqakE0J9NIPodXOg4lBCFy0ePPM8=;
b=OyODcrXK7Z00qc6DAle3V/hddRlUUgYy33WwSmcqN2jExmlsVFc3d3GU4oN0qRa959
mSAPXpg15XzDP+1aPpylWyTlL4s/y0S9u4qQo5SQtAwEBTZn63K+0NBTlHG4kfuAHtvZ
uLc/4ol7uQVtc631Fr2bCp6LeXahMzrHJvv8DvK462sInkuA548IAgD8P2T1c32LRrot
81grRNgD/oF78dLkyinmeTSLg1yaPLQOBtthndPqx+LxU4ySWw/7rtArBjKE0qX0cGzS
dm+le4YQLkLMeuiDF8wcnIK3uPML97AzRy641z6/ApiEtLhIsFpIqdygrmdB0b1jlx9t
ETPQ==
X-Gm-Message-State: APuU4Z8ooIqZ7WutR0ooGLLsyYmKqH5GvBnHTL7eNH01hqZlLJvg95c8
/KLNeAgdEVnF4uAhF0/+iyT65UCs1uxj6f4fCZxWRr0n1gwGZZyDORyN8HcTRA==
X-Gm-Gg: AYBFou1Vw4/9elt8wxBZ7WD1hIu5zvZ74zlGu1qHdMWukOVw71dVXuB8fhA2jQ38pzo
80YtSSwtDSePplANbA34j0DmrgZcWguHszq5FKlIPk1PuW1YGH508hsCknE1Ka0Rv202uXCVkOQ
f7sS3WzBrzB8yQ2zCNPqx+THyI13gYWIqzQKO4by+Z3cD0r8otQ9VmuBA1/fp37qK5h5zTHn1c2
sAf/dJIKE45YSOPLxZ2VepkHgP8DeS3mEsFk8WW/oXLXJQf7HBO8k2hWzXMaxROYKMM7ECnvpC+
zQOvY3Q5bS2AcenwIrP2KSCrWINfNGFD+GhbR76PIpyYY31VXXkcpGQ46KFZ/pm7u+/meaGKzRg
idI/Z08R88/NVUU0kFkft6tLkpb9DoTP2XW870aH73pDV1hRSzYGTsDdRxsSHVBp5OgsKnUkrbT
ZOn3GGH3k30kNGbFxxFfe9hH5k0Mo+C3xzsNQKGicGSGXcsS3zu/3ElU6qSC1fgIHj47FsGjbw/
rjQzlnqTg53Cy5Nni1siOe/kQYEPaeZEhp9Crt7AnU+Qx1sQz1Bi62zjEKSgXrFtM/IwoOMMvU7
LJ5drRjNEwByxZGiAxRf2iRKo2swLtSvt1P56ryB3FI3fj3stesx9zjJwz6d4D6kw33l35vQGw=
=
X-Received: by 2002:a05:7301:6492:b0:36c:a44c:1763 with SMTP id 5a478bee46e88-372575c63f1mr6247355eec.32.1794210243521;
Sun, 08 Nov 2026 23:44:03 -0800 (PST)
X-Received: from Anonymous.localdomain ([152.58.29.17])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-372667d60absm11763451eec.26.2026.11.08.23.44.01
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 08 Nov 2026 23:44:03 -0800 (PST)
X-Cc: git@vger.kernel.org,
Junio C Hamano <gitster@pobox.com>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <CAOLa=ZS3ULcNVjV1DMO-iB+LcC2Gnw+9oU2_7VXKoLvgiVRnbg@mail.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