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

Re: [PATCH v2 2/2] t: use test_config whenever possible

From
Junio C Hamano <gitster@pobox.com>
Date
May 17, 2021, 06:55 UTC
Message-ID
<xmqqsg2l3l38.fsf@gitster.g>
In-Reply-To
<87fsylgadx.fsf@Inspiron.i-did-not-set--mail-host-address--so-tickle-me>
Firmin Martin <firminmartin24@gmail.com> writes:
> fact, I suspect that you misread the diff, cf. the end of the email). 
> I copy here the full test with line number to make sure that we are in
> the same page.
The following is the original test before your patch, right?
Show 18 quoted lines
>>  415 test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
>>  416     (
>>  417         cd downstream &&
>>  418         git fetch --recurse-submodules
>>  419     ) &&
>>  420     add_upstream_commit &&
>>  421     git config --global fetch.recurseSubmodules false &&
>>  422     head1=$(git rev-parse --short HEAD) &&
>>  423     git add submodule &&
>>  424     git commit -m "new submodule" &&
>>  425     head2=$(git rev-parse --short HEAD) &&
>>  426     echo "From $pwd/." > expect.err.2 &&
>>  427     echo "   $head1..$head2  super      -> origin/super" >>expect.err.2 &&
>>  428     head -3 expect.err >> expect.err.2 &&
>>  429     (
>>  430         cd downstream &&
>>  431         git config fetch.recurseSubmodules on-demand &&
>>  432         git fetch >../actual.out 2>../actual.err

Here we run one "fetch" inside downstream, with a config specific to the downstream repository; the expectation is that this on-demand setting is honored, overriding the "global" setting that was set on line 421.

>>  433     ) &&
>>  434     git config --global --unset fetch.recurseSubmodules &&
And then we discard the "global" setting.
>>  435     (
>>  436         cd downstream &&
>>  437         git config --unset fetch.recurseSubmodules

Oh, I thought I saw there was another fetch before this unset between 436 and 437, that writes to the same actual.out and actual.err.

Show 13 quoted lines
> At this point, I have the feeling that you have misread the diff
> (do correct me If I'm wrong) and saw ...
>>  (
>>      cd downstream &&
>>      git config fetch.recurseSubmodules on-demand &&
>>      git fetch >../actual.out 2>../actual.err
>>  ) &&
>>  git config --global --unset fetch.recurseSubmodules &&
>>  (
>>      cd downstream &&
>>      git fetch >../actual.out 2>../actual.err
>>      git config --unset fetch.recurseSubmodules
>>  ) &&
Exactly.  Thanks and sorry for the noise.
Previous: Firmin Martin
Message 15 of 15 in “t/README: document test_config”
  1. 1/2 t/README: document test_configFirmin Martin, May 14, 2021
  2. 2/2 t: use test_config whenever possibleFirmin Martin, May 14, 2021
  3. Felipe ContrerasMay 15, 2021
  4. Felipe ContrerasMay 15, 2021
  5. Firmin MartinMay 15, 2021
  6. Eric SunshineMay 14, 2021
  7. Firmin MartinMay 15, 2021
  8. 0/2 document test_config & use it whenever possibleFirmin Martin, May 15, 2021
  9. 1/2 t/README: document test_configFirmin Martin, May 15, 2021
  10. Bagas SanjayaMay 16, 2021
  11. Firmin MartinMay 17, 2021
  12. 2/2 t: use test_config whenever possibleFirmin Martin, May 15, 2021
  13. Junio C HamanoMay 16, 2021
  14. Firmin MartinMay 17, 2021
  15. Junio C HamanoMay 17, 2021

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.