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

Re: [PATCH v5] submodule: fetch missing objects from default remote

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Mar 3, 2026, 20:47 UTC
Message-ID
<2e62dc94-b821-4815-8dd2-f806580d2027@ramsayjones.plus.com>
In-Reply-To
<20260303200906.4118348-1-nasser.grainawi@oss.qualcomm.com>
On 03/03/2026 8:09 pm, Nasser Grainawi wrote:
Show 19 quoted lines
> When be76c21282 (fetch: ensure submodule objects fetched, 2018-12-06)
> added support for fetching a missing submodule object by id, it
> hardcoded the remote name as "origin" and deferred anything more
> complicated for a later patch. Implement the NEEDSWORK item to remove
> the hardcoded assumption by adding and using a submodule helper subcmd
> 'get-default-remote'. Fixing this lets 'git fetch --recurse-submodules'
> succeed when the fetched commit(s) in the superproject trigger a
> submodule fetch, and that submodule's default remote name is not
> "origin".
> 
> Add non-"origin" remote tests to t5526-fetch-submodules.sh and
> t5572-pull-submodule.sh demonstrating this works as expected and add
> dedicated tests for get-default-remote.
> 
> Signed-off-by: Nasser Grainawi <nasser.grainawi@oss.qualcomm.com>
> Reviewed-by: Jacob Keller <jacob.keller@gmail.com>
> ---
> Fixes for test_when_finished usage within a subshell.
> 

The 't5526-fetch-submodules.sh' test failed for me tonight. Having seen an earlier email about the test_when_finished failures I wasn't too surprised but, once I looked at the failure, it was obviously not the cause of this failure. Indeed, when I ran the test by hand, it passed ... :)

It seems the 'seen' branch (@764d09c9ce) has this v5 version of the patch and (in this test anyway) has some flakiness:

  $ cd t
  $ ./t5526-fetch-submodules.sh --stress >out 2>&1
  $ cat out
  FAIL  4.1
  FAIL  3.1
  FAIL  5.1
  OK    0.1 
  OK    1.1
  OK    6.1 
  OK    7.1
  OK    2.1 
  Log(s) of failed test run(s):
  Contents of '/home/ramsay/git/t/test-results/t5526-fetch-submodules.stress-3.out':
  Initialized empty Git repository in /home/ramsay/git/t/trash directory.t5526-fetch-submodules.stress-3/.git/
  expecting success of 5526.1 'setup': 
  ...
  expecting success of 5526.44 'fetch new submodule commits on-demand outside standard refspec with custom remote name':
  ...
  + diff -u expect_fetch_custom actual_fetch_warnings_removed
  --- expect_fetch_custom 2026-03-03 20:35:13.949600802 +0000
  +++ actual_fetch_warnings_removed       2026-03-03 20:35:14.150601532 +0000
  @@ -4,9 +4,9 @@
   Fetching submodule sub1/subdir/deepsubmodule
   Fetching submodule submodule
   Fetching submodule submodule/subdir/deepsubmodule
  -From /home/ramsay/git/t/trash directory.t5526-fetch-submodules.stress-5/./sub1
  - * branch            43c17d99ab9d4fcabf7107e36660b27113b54663 -> FETCH_HEAD
  -Fetching submodule sub1/subdir/deepsubmodule
   From /home/ramsay/git/t/trash directory.t5526-fetch-submodules.stress-5/submodule
    * branch            e38933e027ee8a2000f603124aa899302a09a51f -> FETCH_HEAD
   Fetching submodule submodule/subdir/deepsubmodule
  +From /home/ramsay/git/t/trash directory.t5526-fetch-submodules.stress-5/./sub1
  + * branch            43c17d99ab9d4fcabf7107e36660b27113b54663 -> FETCH_HEAD
  +Fetching submodule sub1/subdir/deepsubmodule
  error: last command exited with $?=1
  not ok 44 - fetch new submodule commits on-demand outside standard refspec with custom remote name
  ...
  $ 
From which I guess that the order of the output is somewhat unpredictable.

Also, other test files in that patch didn't fail for me with 'make test', but it could be possible that they are also flaky. I didn't look.

Thanks.

ATB, Ramsay Jones

Previous: Nasser GrainawiNext: Junio C Hamano
Message 32 of 36 in “Fetch missing submodule objects from default remote”
  1. Fetch missing submodule objects from default remoteNasser Grainawi, Jan 12, 2026
  2. Jacob KellerJan 13, 2026
  3. Ben KnobleJan 13, 2026
  4. Nasser GrainawiJan 13, 2026
  5. D. Ben KnobleJan 14, 2026
  6. Junio C HamanoJan 14, 2026
  7. Junio C HamanoJan 14, 2026
  8. Nasser GrainawiJan 14, 2026
  9. submodule: fetch missing objects from default remoteNasser Grainawi, Jan 14, 2026
  10. Ben KnobleJan 14, 2026
  11. Nasser GrainawiJan 21, 2026
  12. submodule: fetch missing objects from default remoteNasser Grainawi, Jan 22, 2026
  13. Junio C HamanoJan 22, 2026
  14. Jacob KellerJan 22, 2026
  15. Junio C HamanoJan 22, 2026
  16. Junio C HamanoJan 22, 2026
  17. Junio C HamanoJan 23, 2026
  18. Junio C HamanoJan 24, 2026
  19. Junio C HamanoFeb 20, 2026
  20. Junio C HamanoFeb 25, 2026
  21. Nasser GrainawiFeb 27, 2026
  22. Nasser GrainawiFeb 27, 2026
  23. submodule: fetch missing objects from default remoteNasser Grainawi, Mar 1, 2026
  24. Jacob KellerMar 2, 2026
  25. Jacob KellerMar 2, 2026
  26. Junio C HamanoMar 2, 2026
  27. Junio C HamanoMar 3, 2026
  28. Nasser GrainawiMar 3, 2026
  29. Nasser GrainawiMar 3, 2026
  30. Junio C HamanoMar 3, 2026
  31. submodule: fetch missing objects from default remoteNasser Grainawi, Mar 3, 2026
  32. Ramsay JonesMar 3, 2026
  33. Junio C HamanoMar 3, 2026
  34. Nasser GrainawiMar 3, 2026
  35. submodule: fetch missing objects from default remoteNasser Grainawi, Mar 3, 2026
  36. Junio C HamanoMar 9, 2026

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.