git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Outreachy PATCH v2] t1402: test --no-allow-onelevel option precedence

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 27, 2026, 17:59 UTC
Message-ID
<xmqqcxsvkorm.fsf@gitster.g>
In-Reply-To
<20261027145451.8617-1-fiendora5@gmail.com>
Fien Dora <fiendora5@gmail.com> writes:
Show 11 quoted lines
> Unlike most Git commands that use the parse_options() API,
> check-ref-format relies on a handcrafted loop to parse command-line
> options. Although the --no- prefix is commonly used to negate options
> in Git, the precedence of --allow-onelevel and --no-allow-onelevel
> is not explicitly covered by the existing tests.
>
> Add regression tests for both orders of --allow-onelevel and
> --no-allow-onelevel to verify that the last option takes precedence.
> The tests confirm that --no-allow-onelevel overrides a preceding
> --allow-onelevel, and that --allow-onelevel similarly overrides a
> preceding --no-allow-onelevel.
Nicely described.
> Git's planned work to improve argument parsing includes replacing
> suitable handcrafted parsers with existing APIs.

I haven't heard of anybody planning to do such a conversion, but do you mean you are planning to do such a work as a follow-up? If so, write it more like "I plan to do X in a separate series". If not, please do not make up hallucinated facts.

Show 19 quoted lines
> 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
Previous: Fien DoraNext: Fien Dora
Message 8 of 11 in “t1402: test --no-allow-onelevel option precedence”
  1. t1402: test --no-allow-onelevel option precedenceFien Dora, Oct 26, 2026
  2. Junio C HamanoOct 26, 2026
  3. Fien DoraOct 27, 2026
  4. Junio C HamanoOct 27, 2026
  5. Fien DoraOct 28, 2026
  6. Fien DoraOct 28, 2026
  7. t1402: test --no-allow-onelevel option precedenceFien Dora, Oct 27, 2026
  8. Junio C HamanoOct 27, 2026
  9. Fien DoraOct 28, 2026
  10. t1402: test --no-allow-onelevel option precedenceFien Dora, Oct 29, 2026
  11. Junio C HamanoOct 29, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.