Thread View: linux.kernel.git
3 messages
3 total messages
Started by Hussain Sitamouwala
Mon, 09 Nov 2026 07:43
Re: [PATCH v2] check-ref-format: use parse-options API
Author: 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
Re: [PATCH v2] check-ref-format: use parse-options API
Author: Fien Dora
Date: Fri, 20 Nov 2026 22:28
Date: Fri, 20 Nov 2026 22:28
40 lines
13117 bytes
13117 bytes
On Mon, 9 Nov 2026 at 08:45, Hussain Sitamouwala <husainsitamuwala21@gmail.com> wrote: > 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. Hi Hussain and reviewers, I have been following the discussion on converting check-ref-format to parse_options(), particularly Junio's comments about unsupported negated options, In v2, PARSE_OPT_NONEG is used to preserve the existing behavior of rejecting --no-normalize, --no-print, and --no-refspec-pattern. However, the existing tests do not explicitly verify the rejection of these options. I added three tests to t/t1402-check-ref-format.sh, each checking that one of these options is rejected with exit status 129. I tested the updated script against the original parser and the revised conversion (991ca87). All 112 tests passed on both implementations. For additional verification, I also tested the earlier conversion (9f05296), where the three new tests failed while all 109 existing tests passed. This confirms that the additional tests can detect the behavior change addressed in v2. The proposed tests would provide explicit regression coverage for the behavior preserved by v2. Since the conversion is already under review, would these tests be useful as a separate preparatory patch, or would it be preferable to include them in the existing series? Thanks, Fien Dora
Re: [PATCH v2] check-ref-format: use parse-options API
Author: Hussain Sitamouwala
Date: Sun, 22 Nov 2026 10:29
Date: Sun, 22 Nov 2026 10:29
25 lines
11642 bytes
11642 bytes
Hi Fien, Thank you, this is useful. Junio's question about the --no-* forms in the v1 review was the reason I added PARSE_OPT_NONEG, but I did not add any tests for it. I will run your tests against my branch locally as well. On Fri, 20 Nov 2026, Fien Dora wrote: > Since the conversion is already under review, would these tests be > useful as a separate preparatory patch, or would it be preferable > to include them in the existing series? Since the tests pass with both the original parser and v2, I think adding them before the conversion would show that the conversion does not change behavior. But I would like Junio and Karthik to decide how they want it structured. I am still waiting for their feedback on v2 before preparing v3, so I will follow what they prefer. If the tests are included in the series, I would like Fien to be credited as the author of that patch, with her Signed-off-by. Thanks, Hussain
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads