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

Re: [PATCH 2/2] fetch: do not override partial clone filter

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2020, 15:51 UTC
Message-ID
<xmqqk0wllshb.fsf@gitster.c.googlers.com>
In-Reply-To
<b59f00b6-2787-261e-a295-35eb4a6f442b@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 13 quoted lines
> On 9/22/2020 1:46 AM, Junio C Hamano wrote:
>> Jonathan Tan <jonathantanmy@google.com> writes:
>> 
>>> +test_expect_success 'ensure that filter is written to config' '
>>> +	FILTER=$(git -C client config --get remote.blah.partialclonefilter) &&
>>> +	test "$FILTER" == "blob:limit=0"
>> 
>> I'll do s/==/=/ locally because otherwise the test-lint-shell-syntax
>> will choke on this line.  No need to resend only this line.
>
> Wouldn't "test_cmp_config" be a better here? It seems like
> this is testing the "git clone" behavior of the previous test,
> so it could be added to that test instead.

TIL that one ;-) "git config --get" gives only a single instance, but in this particular case, shouldn't we be verifying not just that the expected one is found, but it is the only one, with "--get-all"?

FWIW, many uses of that test helper may want to be tightened the same way. In short, unless we are testing the last-one-wins behaviour, and especially when we are interested in what changes our tested operation makes to the config file's contents, we should be using "--get-all" instead of the default "--get", I suspect.

Thanks.
Previous: Derrick StoleeNext: Jonathan Tan
Message 5 of 11 in “Fix overriding of partial clone filter when lazy-fetching”
  1. 0/2 Fix overriding of partial clone filter when lazy-fetchingJonathan Tan, Sep 22, 2020
  2. 2/2 fetch: do not override partial clone filterJonathan Tan, Sep 22, 2020
  3. Junio C HamanoSep 22, 2020
  4. Derrick StoleeSep 22, 2020
  5. Junio C HamanoSep 22, 2020
  6. 1/2 promisor-remote: remove unused variableJonathan Tan, Sep 22, 2020
  7. Junio C HamanoSep 22, 2020
  8. 0/2 Fix overriding of partial clone filter when lazy-fetchingJonathan Tan, Sep 28, 2020
  9. 2/2 fetch: do not override partial clone filterJonathan Tan, Sep 28, 2020
  10. Junio C HamanoSep 28, 2020
  11. 1/2 promisor-remote: remove unused variableJonathan Tan, Sep 28, 2020

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.