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

[PATCHv3 00/13] fetch submodules in parallel and a preview on parallel "submodule update"

From
Stefan Beller <sbeller@google.com>
Date
Sep 21, 2015, 22:39 UTC
Message-ID
<1442875159-13027-1-git-send-email-sbeller@google.com>
This build on top of origin/sb/submodule-helper

Patches 1-8 are parallelising fetching submodules. Thanks Eric, Jeff and Junio for the discussion and review! Based on your feedback:

Patch 2 is optional and may be spun out as its own mini series. Instead of spinning we can poll until data are ready on the fd.

Patch 3,4 have been revamped to include your suggestions, having xread_nonblock and strbuf_read_once as their own functions not to be integrated into other existing functions.

Patch 5 was fixed to return 0 or -1 in the error case. Patch 6 has major syntactically changes such as no slots any more, but in_use flags. The return code was flipped (1 means there is a child to be executed, while 0 means we're done).

Patch 7,8 convert git fetch --recuse-submodules to use the fruit of patch 6.

Patches 9 an onwards are RFC, so I could spin them out as their own series as they convert parts of "submodule update" to C using the new asynchronous run command code. Patch 9 adds the update strategy to the submodule cache Patches 10,11,12 are just moving code around to make cmd_update leaner. Patch 13 shows how I plan to parallelize updating the submodules for now.

Any feedback welcome, Thanks, Stefan

Jonathan Nieder (1):
  Sending "Fetching submodule <foo>" output to stderr
Stefan Beller (13):
  xread: poll on non blocking fds
  xread_nonblock: add functionality to read from fds nonblockingly
  strbuf: add strbuf_read_once to read without blocking
  run-command: factor out return value computation
  run-command: add an asynchronous parallel child processor
  fetch_populated_submodules: use new parallel job processing
  submodules: allow parallel fetching, add tests and documentation
  submodule config: keep update strategy around
  git submodule update: pass --prefix only with a non empty prefix
  git submodule update: cmd_update_recursive
  git submodule update: cmd_update_clone
  git submodule update: cmd_update_fetch
  Rewrite submodule update in C
 Documentation/fetch-options.txt |   7 +
 builtin/fetch.c                 |   6 +-
 builtin/pull.c                  |   6 +
 builtin/submodule--helper.c     | 247 +++++++++++++++++++++++++++++
 git-compat-util.h               |   1 +
 git-submodule.sh                | 339 ++++++++++++++--------------------------
 run-command.c                   | 329 +++++++++++++++++++++++++++++++++++---
 run-command.h                   |  38 +++++
 strbuf.c                        |  11 ++
 strbuf.h                        |   6 +
 submodule-config.c              |  16 ++
 submodule-config.h              |   1 +
 submodule.c                     | 119 +++++++++-----
 submodule.h                     |   2 +-
 t/t0061-run-command.sh          |  20 +++
 t/t5526-fetch-submodules.sh     |  70 ++++++---
 test-run-command.c              |  24 +++
 wrapper.c                       |  41 ++++-
 18 files changed, 972 insertions(+), 311 deletions(-)
-- 
2.5.0.275.ge015d2a
Next: Stefan Beller
Message 1 of 48 in “[PATCHv3 00/13] fetch submodules in parallel and a preview on parallel "submodule update"”
  1. Stefan BellerSep 21, 2015
  2. 01/13 Sending "Fetching submodule <foo>" output to stderrStefan Beller, Sep 21, 2015
  3. Junio C HamanoSep 21, 2015
  4. 02/13 xread: poll on non blocking fdsStefan Beller, Sep 21, 2015
  5. Junio C HamanoSep 21, 2015
  6. Torsten BögershausenSep 22, 2015
  7. Jacob KellerSep 22, 2015
  8. Torsten BögershausenSep 22, 2015
  9. Junio C HamanoSep 22, 2015
  10. Jeff KingSep 22, 2015
  11. Junio C HamanoSep 22, 2015
  12. Stefan BellerSep 23, 2015
  13. Junio C HamanoSep 23, 2015
  14. Jeff KingSep 23, 2015
  15. Eric SunshineSep 21, 2015
  16. Junio C HamanoSep 22, 2015
  17. Stefan BellerSep 22, 2015
  18. Junio C HamanoSep 22, 2015
  19. Stefan BellerSep 22, 2015
  20. 03/13 xread_nonblock: add functionality to read from fds nonblockinglyStefan Beller, Sep 21, 2015
  21. Junio C HamanoSep 22, 2015
  22. Junio C HamanoSep 22, 2015
  23. Jacob KellerSep 22, 2015
  24. Jacob KellerSep 22, 2015
  25. Junio C HamanoSep 22, 2015
  26. 04/13 strbuf: add strbuf_read_once to read without blockingStefan Beller, Sep 21, 2015
  27. Junio C HamanoSep 22, 2015
  28. Jacob KellerSep 22, 2015
  29. 05/13 run-command: factor out return value computationStefan Beller, Sep 21, 2015
  30. Junio C HamanoSep 22, 2015
  31. 06/13 run-command: add an asynchronous parallel child processorStefan Beller, Sep 21, 2015
  32. Junio C HamanoSep 22, 2015
  33. Stefan BellerSep 22, 2015
  34. Junio C HamanoSep 22, 2015
  35. Stefan BellerSep 22, 2015
  36. Junio C HamanoSep 22, 2015
  37. Stefan BellerSep 22, 2015
  38. Junio C HamanoSep 22, 2015
  39. 07/13 fetch_populated_submodules: use new parallel job processingStefan Beller, Sep 21, 2015
  40. Junio C HamanoSep 22, 2015
  41. 08/13 submodules: allow parallel fetching, add tests and documentationStefan Beller, Sep 21, 2015
  42. 09/13 submodule config: keep update strategy aroundStefan Beller, Sep 21, 2015
  43. Eric SunshineSep 22, 2015
  44. Stefan BellerSep 22, 2015
  45. 10/13 git submodule update: cmd_update_recursiveStefan Beller, Sep 21, 2015
  46. 11/13 git submodule update: cmd_update_cloneStefan Beller, Sep 21, 2015
  47. 12/13 git submodule update: cmd_update_fetchStefan Beller, Sep 21, 2015
  48. 13/13 Rewrite submodule update in CStefan Beller, Sep 21, 2015

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.