* [Outreachy] Question about check-ref-format test coverage
@ 2026-10-23 15:29 Fien Dora
2026-10-23 15:53 ` Harald Nordgren
2026-10-24 9:48 ` Phillip Wood
0 siblings, 2 replies; 5+ messages in thread
From: Fien Dora @ 2026-10-23 15:29 UTC (permalink / raw)
To: git
Hello Everyone,
I'm called Fien Dora and outreachy applicant for the December 2026
Cohort. I'm interested in the git project "Improve how command
arguments and options are scanned and parsed."
I'm new to open source generally but i'm ready to learn and contribute
I've been getting familiar with the git codebase, I've successfully
cloned and built Git from the source on my Mac, ran the
parse-options(96 test) and check-ref-format tests (107 tests), all
passed.
While I was exploring builtin/check-ref-format.c, I noticed that Git
supports --allow-onelevel and --no-allow-onelevel, but I couldn't find
any tests of --no-allow-onelevel in the t/ directory.
i tried running
./git check-ref-format --allow-onelevel foo
./git check-ref-format --allow-onelevel --no-allow-onelevel foo
it returned with an exit code of 0 and 1 respectively.
I've also gone through the list archives and saw an earlier outreachy
work converting check-ref-format to use parse-options.
Would adding tests for --allow-onelevel, particularly how it works
with --no-allow-onelevel be a good contribution for my Outreachy
microproject?
I look forward for any guidance
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy] Question about check-ref-format test coverage
2026-10-23 15:29 [Outreachy] Question about check-ref-format test coverage Fien Dora
@ 2026-10-23 15:53 ` Harald Nordgren
2026-10-24 9:52 ` Phillip Wood
2026-10-24 9:48 ` Phillip Wood
1 sibling, 1 reply; 5+ messages in thread
From: Harald Nordgren @ 2026-10-23 15:53 UTC (permalink / raw)
To: Fien Dora; +Cc: git
> i tried running
>
> ./git check-ref-format --allow-onelevel foo
>
> ./git check-ref-format --allow-onelevel --no-allow-onelevel foo
>
>
> it returned with an exit code of 0 and 1 respectively.
`--allow-onelevel´ and ´--no-allow-onelevel´ are contradictory
options, and shouldn't be run together, so that's likely why it failed
with exit code 1.
This is true for any `--xyz´ and ´--no-xyz´ options.
Harald
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy] Question about check-ref-format test coverage
2026-10-23 15:29 [Outreachy] Question about check-ref-format test coverage Fien Dora
2026-10-23 15:53 ` Harald Nordgren
@ 2026-10-24 9:48 ` Phillip Wood
1 sibling, 0 replies; 5+ messages in thread
From: Phillip Wood @ 2026-10-24 9:48 UTC (permalink / raw)
To: Fien Dora, git
Hi Fien
On 23/10/2026 16:29, Fien Dora wrote:
> Hello Everyone,
> I'm called Fien Dora and outreachy applicant for the December 2026
> Cohort. I'm interested in the git project "Improve how command
> arguments and options are scanned and parsed."
> I'm new to open source generally but i'm ready to learn and contribute
>
> I've been getting familiar with the git codebase, I've successfully
> cloned and built Git from the source on my Mac, ran the
> parse-options(96 test) and check-ref-format tests (107 tests), all
> passed.
That's good
> While I was exploring builtin/check-ref-format.c, I noticed that Git
> supports --allow-onelevel and --no-allow-onelevel, but I couldn't find
> any tests of --no-allow-onelevel in the t/ directory.
Yes, "git grep -e --no-allow-onelevel" shows we don't have any tests for
that, adding one would be useful.
> i tried running
>
> ./git check-ref-format --allow-onelevel foo
>
> ./git check-ref-format --allow-onelevel --no-allow-onelevel foo
>
> it returned with an exit code of 0 and 1 respectively.
That's expected because --no-allow-onelevel comes later on the command
line it overrides --allow-onelevel and so we exit 1 because the ref does
not contain a '/' character.
> I've also gone through the list archives and saw an earlier outreachy
> work converting check-ref-format to use parse-options.
It's great that you've checked the archives, be sure to bear in mind the
feedback that was given when you're writing your patch.
> Would adding tests for --allow-onelevel, particularly how it works
> with --no-allow-onelevel be a good contribution for my Outreachy
> microproject?
It sounds like a useful project to me, it is small and self contained
and improves our codebase.
Thanks
Phillip
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy] Question about check-ref-format test coverage
2026-10-23 15:53 ` Harald Nordgren
@ 2026-10-24 9:52 ` Phillip Wood
2026-10-24 18:37 ` Fien Dora
0 siblings, 1 reply; 5+ messages in thread
From: Phillip Wood @ 2026-10-24 9:52 UTC (permalink / raw)
To: Harald Nordgren, Fien Dora; +Cc: git
On 23/10/2026 16:53, Harald Nordgren wrote:
>>
>> ./git check-ref-format --allow-onelevel foo
>>
>> ./git check-ref-format --allow-onelevel --no-allow-onelevel foo
>>
>> it returned with an exit code of 0 and 1 respectively.
>
> `--allow-onelevel´ and ´--no-allow-onelevel´ are contradictory
> options, and shouldn't be run together, so that's likely why it failed
> with exit code 1.
>
> This is true for any `--xyz´ and ´--no-xyz´ options.
Our commands allow "--no-xyz" to override "--xyz" which is useful when
an alias includes "--xyz" and you want to use the alias without that
option. The second command above exits 1 because "foo" is a one-level
ref and we've passed "--no-allow-onelevel" which overrides the earlier
"--allow-onelevel"
Thanks
Phillip
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy] Question about check-ref-format test coverage
2026-10-24 9:52 ` Phillip Wood
@ 2026-10-24 18:37 ` Fien Dora
0 siblings, 0 replies; 5+ messages in thread
From: Fien Dora @ 2026-10-24 18:37 UTC (permalink / raw)
To: phillip.wood; +Cc: Harald Nordgren, git
Hi Phillip,
> It sounds like a useful project to me, it is small and self contained
> and improves our codebase.
>> Our commands allow "--no-xyz" to override "--xyz" which is useful
>> when
>> an alias includes "--xyz" and you want to use the alias without that
>> option. The second command above exits 1 because "foo" is a one-level
>> ref and we've passed "--no-allow-onelevel" which overrides the earlier
>> "--allow-onelevel"
Thank you for the feedback and for clarifying how the options override
each other.
I'll work on adding the tests and share the patch for review.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-24 18:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-23 15:29 [Outreachy] Question about check-ref-format test coverage Fien Dora
2026-10-23 15:53 ` Harald Nordgren
2026-10-24 9:52 ` Phillip Wood
2026-10-24 18:37 ` Fien Dora
2026-10-24 9:48 ` Phillip Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox