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

[PATCH 0/7] Finish converting "submodule update" to C

From
Glen Choo <chooglen@google.com>
Date
Mar 15, 2022, 21:09 UTC
Message-ID
<20220315210925.79289-1-chooglen@google.com>

Original series: https://lore.kernel.org/git/20220210092833.55360-1-chooglen@google.com "git submodule update" in C part 1: https://lore.kernel.org/git/20220301000816.56177-1-chooglen@google.com/ Based off 'gc/submodule-update-part-1'.

= Overview

This is part 2 of 2 series that supersedes ar/submodule-update. This finishes the conversion of "git submodule update" to C by:

- combining the constituent "git submodule--helper" commands
  ("update-clone" and "run-update-procedure") to create "git
  submodule--helper update"
- converting the --recursive flag to C by teaching "git
  submodule--helper update" to invoke itself

This also fixes a test failure that Junio noted in https://lore.kernel.org/git/xmqqr18770pc.fsf@gitster.g (see patch 6 for more details).

= Known conflicts

This series is missing some functionality introduced in the in-flight es/superproject-aware-submodules [1], namely, that "git submodule update" sets `submodule.hasSuperproject` on all submodules. I intended for this to go _after_ es/superproject-aware-submodules, and in that series, Emily and I tried to simplify this conflict by preemptively doing this in C (see that series' v9 cover letter [1]).

That discussion is still ongoing, but it seems helpful to send this series anyway (thanks to all who weighed in over IRC [2]). At any rate, neither series really depends on the other, so this series is still independently reviewable, but with the caveat that I may add another patch that adds the missing behavior (it will probably look something like [3]).

Alternatively, this series might graduate first. In which case, I'll continue working with Emily to fix the conflict.

= Patch organization

This series largely follows the remaining ar/submodule-update patches that weren't included in part 1 and some additional clean ups. One notable difference vis-a-vis ar/submodule-update is that the CLI args for "update-clone" are no longer copied across structs (see patch 4 for more details).

- Patches 1-2 teaches "run-update-procedure" to exit and report its
  failures in a more idiomatic manner instead of relying on
  git-submodule.sh.
- Patches 3-4 prepare for "run-update-procedure" and
  "update-clone"'s args to be merged into a single struct.
- Patches 5-6 finish the process of implementing `submodule--helper
  update`.
- Patch 7 cleans up a forward declaration that kept the diffs small
  while we were in the process of conversion, but is no longer needed.

[1] https://lore.kernel.org/git/20220310004423.2627181-1-emilyshaffer@google.com [2] https://colabti.org/irclogger/irclogger_log/git-devel?date=2022-03-14 [3] https://lore.kernel.org/git/kl6l1qz9s6tu.fsf@chooglen-macbookpro.roam.corp.google.com

Atharva Raykar (2):
  submodule--helper: run update using child process struct
  submodule: move core cmd_update() logic to C
Glen Choo (4):
  submodule update: use die_message()
  submodule--helper: teach update_data more options
  submodule--helper: reduce logic in run_update_procedure()
  submodule--helper: remove forward declaration
Ævar Arnfjörð Bjarmason (1):
  builtin/submodule--helper.c: rename option struct to "opt"
 builtin/submodule--helper.c | 691 ++++++++++++++++++------------------
 git-submodule.sh            | 105 +-----
 2 files changed, 361 insertions(+), 435 deletions(-)
base-commit: c9d256249375c7b8a1773139791448860b5789ff
-- 
2.33.GIT
Next: Glen Choo
Message 1 of 8 in “Finish converting "submodule update" to C”
  1. 0/7 Finish converting "submodule update" to CGlen Choo, Mar 15, 2022
  2. 1/7 submodule--helper: run update using child process structGlen Choo, Mar 15, 2022
  3. 2/7 submodule update: use die_message()Glen Choo, Mar 15, 2022
  4. 3/7 builtin/submodule--helper.c: rename option struct to "opt"Glen Choo, Mar 15, 2022
  5. 4/7 submodule--helper: teach update_data more optionsGlen Choo, Mar 15, 2022
  6. 5/7 submodule--helper: reduce logic in run_update_procedure()Glen Choo, Mar 15, 2022
  7. 6/7 submodule: move core cmd_update() logic to CGlen Choo, Mar 15, 2022
  8. 7/7 submodule--helper: remove forward declarationGlen Choo, Mar 15, 2022

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.