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

Re: [RFC PATCH] clone: add clone.recursesubmodules config option

From
Stefan Beller <sbeller@google.com>
Date
Oct 3, 2016, 17:18 UTC
Message-ID
<CAGZ79kbNVy7VFj31m7VKZYP6xphkV_d9Y1x9Q0_=5PZ+_068HA@mail.gmail.com>
In-Reply-To
<57F27B02.8080803@game-point.net>
On Mon, Oct 3, 2016 at 8:36 AM, Jeremy Morton <admin@game-point.net> wrote:
> Did this ever get anywhere?  Can we recursively update submodules with "git
> pull" in the supermodule now?
I think the idea is sound.
>> diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
>> index 7ca10b8..fc2c189 100755
>> --- a/t/t7407-submodule-foreach.sh
>> +++ b/t/t7407-submodule-foreach.sh

Not sure if t7407-submodule-foreach.sh is the best place to put these tests, as it is not `submodule foreach`, maybe put it into 7400 (though that is larger already)

>> +test_expect_success 'use "git clone" with clone.recursesubmodules to
>> checkout all submodules' '
>> +       git config --local clone.recursesubmodules true&&

Nit of the day: I think we prefer a single white space between the line and the ending &&.

No need for --local as that is the default. However I'd propose to use test_config here, as then the option is cleaned up after the test automatically.

Show 15 quoted lines
>> +       git clone super clone7&&
>> +       (
>> +               cd clone7&&
>> +               git rev-parse --resolve-git-dir .git&&
>> +               git rev-parse --resolve-git-dir sub1/.git&&
>> +               git rev-parse --resolve-git-dir sub2/.git&&
>> +               git rev-parse --resolve-git-dir sub3/.git&&
>> +               git rev-parse --resolve-git-dir nested1/.git&&
>> +               git rev-parse --resolve-git-dir nested1/nested2/.git&&
>> +               git rev-parse --resolve-git-dir
>> nested1/nested2/nested3/.git&&
>> +               git rev-parse --resolve-git-dir
>> nested1/nested2/nested3/submodule/.git
>> +       )&&
>> +       git config --local --unset clone.recursesubmodules
No need to unset it here when test_config is used.

We'd maybe would want to also test that git -c clone.recursesubmodules clone --no-recursive ... works as expected (the --no-recursive taking precedence over the config option)

Previous: Jeremy MortonNext: Heiko Voigt
Message 20 of 21 in “Paper cut bug: Why isn't "git clone xxxx" recursive by default?”
  1. Mara KimJun 3, 2014
  2. Junio C HamanoJun 3, 2014
  3. Junio C HamanoJun 3, 2014
  4. Mara KimJun 3, 2014
  5. clone: add clone.recursesubmodules config optionChris Packham, Jun 4, 2014
  6. Junio C HamanoJun 4, 2014
  7. Jens LehmannJun 4, 2014
  8. Junio C HamanoJun 5, 2014
  9. W. Trevor KingJun 5, 2014
  10. Heiko VoigtJun 6, 2014
  11. Jeremy MortonAug 2, 2017
  12. Stefan BellerAug 2, 2017
  13. Heiko VoigtJun 4, 2014
  14. Chris PackhamJun 5, 2014
  15. Heiko VoigtJun 6, 2014
  16. Junio C HamanoJun 6, 2014
  17. Jens LehmannJun 9, 2014
  18. W. Trevor KingJun 9, 2014
  19. Jeremy MortonOct 3, 2016
  20. Stefan BellerOct 3, 2016
  21. Heiko VoigtOct 4, 2016

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.