{"thread":{"id":"66645","subject":"[Outreachy] Question about check-ref-format test coverage","startedAt":"2026-10-23T15:29:12Z","lastAt":"2026-10-24T18:37:12Z","messageCount":5,"participants":["Fien Dora","Harald Nordgren","Phillip Wood"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"556065","messageId":"CACWAS-X4BqnMa8iJKTakF5E=zYkkyr=qsQ-=c3bxoAJ+Kpcfiw@mail.gmail.com","threadId":"66645","inReplyTo":null,"subject":"[Outreachy] Question about check-ref-format test coverage","fromName":"Fien Dora","fromEmail":"fiendora5@gmail.com","sentAt":"2026-10-23T15:29:12Z","receivedAt":"2026-10-23T15:29:12Z","isPatch":false,"sender":{"key":"fiendora5@gmail.com","avatar":null},"body":"Hello Everyone,\nI'm called Fien Dora and outreachy applicant for the December 2026\nCohort. I'm interested in the git project \"Improve how command\narguments and options are scanned and parsed.\"\nI'm new to open source generally but i'm ready to learn and contribute\n\nI've been getting familiar with the git codebase, I've successfully\ncloned and built Git from the source on my Mac, ran the\nparse-options(96 test) and check-ref-format tests (107 tests), all\npassed.\n\nWhile I was exploring builtin/check-ref-format.c, I noticed that Git\nsupports --allow-onelevel and --no-allow-onelevel, but I couldn't find\nany tests of --no-allow-onelevel in the t/ directory.\n\ni tried running\n\n./git check-ref-format --allow-onelevel foo\n\n./git check-ref-format --allow-onelevel --no-allow-onelevel foo\n\n\nit returned with an exit code of 0 and 1 respectively.\n\n\nI've also gone through the list archives and saw an earlier outreachy\nwork converting check-ref-format to use parse-options.\n\n\nWould adding tests for --allow-onelevel, particularly how it works\nwith --no-allow-onelevel be a good contribution for my Outreachy\nmicroproject?\n\nI look forward for any guidance\n\n"},{"id":"556070","messageId":"CAHwyqnXEC7cFijGWATqfA+fBcn09UoNPBDA17GYEY4P8mS0fWA@mail.gmail.com","threadId":"66645","inReplyTo":"CACWAS-X4BqnMa8iJKTakF5E=zYkkyr=qsQ-=c3bxoAJ+Kpcfiw@mail.gmail.com","subject":"Re: [Outreachy] Question about check-ref-format test coverage","fromName":"Harald Nordgren","fromEmail":"haraldnordgren@gmail.com","sentAt":"2026-10-23T15:53:48Z","receivedAt":"2026-10-23T15:53:48Z","isPatch":false,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"> i tried running\n>\n> ./git check-ref-format --allow-onelevel foo\n>\n> ./git check-ref-format --allow-onelevel --no-allow-onelevel foo\n>\n>\n> it returned with an exit code of 0 and 1 respectively.\n\n`--allow-onelevel´ and ´--no-allow-onelevel´ are contradictory\noptions, and shouldn't be run together, so that's likely why it failed\nwith exit code 1.\n\nThis is true for any `--xyz´ and ´--no-xyz´ options.\n\n\nHarald\n\n"},{"id":"556147","messageId":"2907524c-4869-4280-949b-e6fb930e57b2@gmail.com","threadId":"66645","inReplyTo":"CACWAS-X4BqnMa8iJKTakF5E=zYkkyr=qsQ-=c3bxoAJ+Kpcfiw@mail.gmail.com","subject":"Re: [Outreachy] Question about check-ref-format test coverage","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-24T09:48:14Z","receivedAt":"2026-10-24T09:48:14Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Fien\n\nOn 23/10/2026 16:29, Fien Dora wrote:\n> Hello Everyone,\n> I'm called Fien Dora and outreachy applicant for the December 2026\n> Cohort. I'm interested in the git project \"Improve how command\n> arguments and options are scanned and parsed.\"\n> I'm new to open source generally but i'm ready to learn and contribute\n> > I've been getting familiar with the git codebase, I've successfully\n> cloned and built Git from the source on my Mac, ran the\n> parse-options(96 test) and check-ref-format tests (107 tests), all\n> passed.\n\nThat's good\n\n> While I was exploring builtin/check-ref-format.c, I noticed that Git\n> supports --allow-onelevel and --no-allow-onelevel, but I couldn't find\n> any tests of --no-allow-onelevel in the t/ directory.\n\nYes, \"git grep -e --no-allow-onelevel\" shows we don't have any tests for that, adding one would be useful.\n\n> i tried running\n> > ./git check-ref-format --allow-onelevel foo\n> > ./git check-ref-format --allow-onelevel --no-allow-onelevel foo\n> > it returned with an exit code of 0 and 1 respectively.\n\nThat'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.\n\n> I've also gone through the list archives and saw an earlier outreachy\n> work converting check-ref-format to use parse-options.\n\nIt'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.\n> Would adding tests for --allow-onelevel, particularly how it works\n> with --no-allow-onelevel be a good contribution for my Outreachy\n> microproject?\n\nIt sounds like a useful project to me, it is small and self contained and improves our codebase.\n\nThanks\n\nPhillip\n\n\n"},{"id":"556148","messageId":"bd00b525-6e05-4c17-91ef-3d9c80ff2784@gmail.com","threadId":"66645","inReplyTo":"CAHwyqnXEC7cFijGWATqfA+fBcn09UoNPBDA17GYEY4P8mS0fWA@mail.gmail.com","subject":"Re: [Outreachy] Question about check-ref-format test coverage","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-24T09:52:29Z","receivedAt":"2026-10-24T09:52:29Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 23/10/2026 16:53, Harald Nordgren wrote:\n>>\n>> ./git check-ref-format --allow-onelevel foo\n>>\n>> ./git check-ref-format --allow-onelevel --no-allow-onelevel foo\n>>\n>> it returned with an exit code of 0 and 1 respectively.\n> > `--allow-onelevel´ and ´--no-allow-onelevel´ are contradictory\n> options, and shouldn't be run together, so that's likely why it failed\n> with exit code 1.\n>\n> This is true for any `--xyz´ and ´--no-xyz´ options.\n\nOur 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\"\n\nThanks\n\nPhillip\n\n\n"},{"id":"556184","messageId":"CACWAS-U6OUMcmhLK_aRTc8jt1DXk6eNAs9xz1xmmHDM8L_73Uw@mail.gmail.com","threadId":"66645","inReplyTo":"bd00b525-6e05-4c17-91ef-3d9c80ff2784@gmail.com","subject":"Re: [Outreachy] Question about check-ref-format test coverage","fromName":"Fien Dora","fromEmail":"fiendora5@gmail.com","sentAt":"2026-10-24T18:37:12Z","receivedAt":"2026-10-24T18:37:12Z","isPatch":false,"sender":{"key":"fiendora5@gmail.com","avatar":null},"body":"Hi Phillip,\n\n> It sounds like a useful project to me, it is small and self contained\n> and improves our codebase.\n\n>> Our commands allow \"--no-xyz\" to override \"--xyz\" which is useful\n>> when\n>> an alias includes \"--xyz\" and you want to use the alias without that\n>> option. The second command above exits 1 because \"foo\" is a one-level\n>> ref and we've passed \"--no-allow-onelevel\" which overrides the earlier\n>> \"--allow-onelevel\"\n\nThank you for the feedback and for clarifying how the options override\neach other.\n\nI'll work on adding the tests and share the patch for review.\n\n"}]}