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

Re: [PATCH] partial-clone: add a partial-clone test case

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2022, 21:42 UTC
Message-ID
<xmqqsfrknrck.fsf@gitster.g>
In-Reply-To
<e38ebbfd-3ce4-6900-97e4-74b987c08b7d@github.com>
Derrick Stolee <derrickstolee@github.com> writes:
Show 26 quoted lines
>> 	git -c fetch.negotiationAlgorithm=noop fetch origin --no-tags --no-write-fetch-head --recurse-submodules=no --filter=blob:none --stdin
>> 
>> Derrick told me to not depend on other flags like
>> `-c fetch.negotiationAlgorithm` etc. as they might be changed or omitted
>> and as it makes sense to me also. That's why I didn't specify those things.
>
> This reason is something that could be mentioned in the commit message
> to motivate the change to the helper.
>
>>> I wonder if it was more like this that the original wanted to grep for:
>>>
>>> 	grep '"event":"child_start".*\["git","pack-objects",.*\]'
>> 
>> I don't know about other cases, but in my case, atleast I really wanted
>> it.
>> 
>> So, In this scenerio, should I stick with `test_subcommand_inexact` or I
>> have to see other helper functions (or make my own) for it?
>
> As I mentioned earlier, it seems that
>
> 	test_subcommand_inexact ! git fetch
>
> would actually work for your needs without changing the helper. We will see
> whether or not the helper needs to be updated in a way that that line would
> not work anymore.

Ah, that is because the current implementation of the helper sprinkles ".*" in between each and every pair of parameters, so the resulting pattern \["git".*"fetch".*\] would not be prevented from matching by the presence of "-c var.iable=value"?

In any case, the _inexact helper may need to be rethought, or at least documented better what inexact-ness it wants to allow. With no concrete goals written down, my guess was that it wanted to ensure only the earlier command names and options, while ignoring the later arguments. And that was where my "adding .* in between looks wrong, and stripping trailing comma with ${expt%,} is nonsense" comment came from.

Thanks.
Previous: Derrick StoleeNext: Abhradeep Chakraborty
Message 5 of 16 in “partial-clone: add a partial-clone test case”
  1. partial-clone: add a partial-clone test caseAbhradeep Chakraborty via GitGitGadget, Mar 13, 2022
  2. Junio C HamanoMar 13, 2022
  3. Abhradeep ChakrabortyMar 14, 2022
  4. Derrick StoleeMar 14, 2022
  5. Junio C HamanoMar 14, 2022
  6. Abhradeep ChakrabortyMar 15, 2022
  7. Junio C HamanoMar 14, 2022
  8. Derrick StoleeMar 14, 2022
  9. Junio C HamanoMar 14, 2022
  10. Abhradeep ChakrabortyMar 15, 2022
  11. Derrick StoleeMar 15, 2022
  12. Abhradeep ChakrabortyMar 15, 2022
  13. Junio C HamanoMar 15, 2022
  14. Abhradeep ChakrabortyMar 16, 2022
  15. partial-clone: add a partial-clone test caseAbhradeep Chakraborty via GitGitGadget, Mar 16, 2022
  16. Derrick StoleeMar 21, 2022

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.