From: Hussain Sitamouwala <husainsitamuwala21@gmail.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2] check-ref-format: use parse-options API
Date: Mon, 9 Nov 2026 07:43:52 +0000 [thread overview]
Message-ID: <20261109074352.163019-1-husainsitamuwala21@gmail.com> (raw)
In-Reply-To: <CAOLa=ZS3ULcNVjV1DMO-iB+LcC2Gnw+9oU2_7VXKoLvgiVRnbg@mail.gmail.com>
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
prev parent reply other threads:[~2026-11-09 7:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 18:33 [PATCH] check-ref-format: use parse-options API Husain Sitamuwala via GitGitGadget
2026-10-29 20:09 ` Junio C Hamano
2026-11-03 8:33 ` [PATCH v2] " Husain Sitamuwala via GitGitGadget
2026-11-03 10:00 ` Karthik Nayak
2026-11-03 18:46 ` Junio C Hamano
2026-11-09 7:43 ` Hussain Sitamouwala [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261109074352.163019-1-husainsitamuwala21@gmail.com \
--to=husainsitamuwala21@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=karthik.188@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox