From: Hussain Sitamouwala Date: Mon, 09 Nov 2026 07:43:52 GMT Subject: Re: [PATCH v2] check-ref-format: use parse-options API Message-ID: <20261109074352.163019-1-husainsitamuwala21@gmail.com> In-Reply-To: Karthik Nayak 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 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 . 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