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

Re: [PATCH v3] submodules: fix of regression on fetching of non-init subsub-repo

From
PKPeter Kästle <peter.kaestle@nokia.com>
Date
Dec 9, 2020, 09:58 UTC
Message-ID
<c0971d1b-3bc5-8004-09f8-7ce10fb3df26@nokia.com>
In-Reply-To
<CADtb9DwwfAG69YmM0+0FC6qkO361-95Uy8dNZ8jXnrVcxHSrMQ@mail.gmail.com>
Hi Philippe,

when sending the patch yesterday, I had the gut feeling to hold it back to double check it a day later. Should have done so, some of your findings were really stupid mistakes.

On 09.12.20 00:25, Philippe Blain wrote:
Show 11 quoted lines
> Le mar. 8 déc. 2020, à 10 h 43, Peter Kaestle
> <peter.kaestle@nokia.com> a écrit :
>>
>>   -- 8< --
>>
>> Furthermore a regression test case is added, which tests for recursive
>> fetches on a superproject with uninitialized sub repositories.  This
>> issue was leading to an infinite loop when doing a revert of a62387b.
> 
> I think this paragraph could be removed as it's saying the same thing as
> the one below.
jip.
[...]
>> +fetch_with_recusion_abort () {
> 
> s/recusion/recursion/
> 
yes.
[...]
Show 44 quoted lines
>> +test_expect_success 'setup recursive fetch with uninit submodule' '
>> +       # does not depend on any previous test setups
>> +
>> +       # setup a remote superproject to make git fetch work with an uninit submodule
>> +       git init --bare super_bare &&
>> +       git clone super_bare super &&
>> +       git init sub &&
>> +
>> +       >sub/file &&
>> +       git -C sub add file &&
>> +       git -C sub commit -m "add file" &&
>> +       git -C sub rev-parse HEAD >expect &&
>> +
>> +       # adding submodule without cloning
>> +       echo "[submodule \"sub\"]" >super/.gitmodules &&
>> +       echo "path = sub" >>super/.gitmodules &&
>> +       echo "url = ../sub" >>super/.gitmodules &&
>> +       git -C super update-index --add --cacheinfo 160000 $(cat expect) sub &&
>> +       mkdir super/sub &&
>> +
>> +       git -C super submodule status >out &&
>> +       sed -e "s/^-//" -e "s/ sub.*$//" out >actual &&
>> +       test_cmp expect actual
>> +'
> 
> I think this is overly complicated, what I was hinting at was adding
> the submodule
> in the superproject before cloning it, so something along these lines:
> 
> test_create_repo super &&
> test_commit -C super initial &&
> test_create_repo sub &&
> test_commit -C sub initial &&
> git -C sub rev-parse HEAD >expect &&
> 
> git -C super submodule add ../sub &&
> git -C super commit -m "add sub" &&
> 
> git clone super superclone &&
> git -C superclone submodule status >out &&
> sed -e "s/^-//" -e "s/ sub.*$//" out >actual &&
> test_cmp expect actual
> 
> And then running the two tests below in "superclone".

Indeed, looks much simpler, I gave it a try run and it resulted in same behavior, will double check the logic of it and then send v4. Thanks a lot.

[...]
-- 
kind regards
--peter;
Previous: Philippe BlainNext: Peter Kaestle
Message 27 of 36 in “BUG in fetching non-checked out submodule”
  1. Ralf ThielowDec 2, 2020
  2. Philippe BlainDec 2, 2020
  3. Junio C HamanoDec 2, 2020
  4. Peter KästleDec 3, 2020
  5. Philippe BlainDec 3, 2020
  6. Peter KästleDec 3, 2020
  7. Junio C HamanoDec 3, 2020
  8. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 4, 2020
  9. Eric SunshineDec 4, 2020
  10. Peter KästleDec 7, 2020
  11. Eric SunshineDec 7, 2020
  12. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 7, 2020
  13. Philippe BlainDec 7, 2020
  14. Junio C HamanoDec 7, 2020
  15. Peter KästleDec 8, 2020
  16. Junio C HamanoDec 7, 2020
  17. Peter KästleDec 8, 2020
  18. Junio C HamanoDec 7, 2020
  19. Philippe BlainDec 7, 2020
  20. Junio C HamanoDec 7, 2020
  21. Junio C HamanoDec 7, 2020
  22. Peter KästleDec 8, 2020
  23. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 8, 2020
  24. Peter KästleDec 8, 2020
  25. Junio C HamanoDec 8, 2020
  26. Philippe BlainDec 8, 2020
  27. Peter KästleDec 9, 2020
  28. submodules: fix of regression on fetching of non-init subsub-repoPeter Kaestle, Dec 9, 2020
  29. Philippe BlainDec 9, 2020
  30. Ralf ThielowDec 3, 2020
  31. Peter KästleDec 3, 2020
  32. Ralf ThielowDec 3, 2020
  33. Peter KästleDec 3, 2020
  34. Ralf ThielowDec 3, 2020
  35. Peter KästleDec 3, 2020
  36. Ralf ThielowDec 3, 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.