git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Glen Choo <chooglen@google.com>
To: git@vger.kernel.org
Cc: "Glen Choo" <chooglen@google.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Atharva Raykar" <raykar.ath@gmail.com>,
	"Emily Shaffer" <emilyshaffer@google.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 0/7] Finish converting "submodule update" to C
Date: Tue, 15 Mar 2022 14:09:18 -0700	[thread overview]
Message-ID: <20220315210925.79289-1-chooglen@google.com> (raw)

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


             reply	other threads:[~2022-03-15 21:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 21:09 Glen Choo [this message]
2022-03-15 21:09 ` [PATCH 1/7] submodule--helper: run update using child process struct Glen Choo
2022-03-15 21:09 ` [PATCH 2/7] submodule update: use die_message() Glen Choo
2022-03-15 21:09 ` [PATCH 3/7] builtin/submodule--helper.c: rename option struct to "opt" Glen Choo
2022-03-15 21:09 ` [PATCH 4/7] submodule--helper: teach update_data more options Glen Choo
2022-03-15 21:09 ` [PATCH 5/7] submodule--helper: reduce logic in run_update_procedure() Glen Choo
2022-03-15 21:09 ` [PATCH 6/7] submodule: move core cmd_update() logic to C Glen Choo
2022-03-15 21:09 ` [PATCH 7/7] submodule--helper: remove forward declaration Glen Choo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220315210925.79289-1-chooglen@google.com \
    --to=chooglen@google.com \
    --cc=avarab@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=raykar.ath@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).