Re: [PATCH v4 7/7] submodule: move core cmd_update() logic to C
- From
Glen Choo <chooglen@google.com>
- Date
- Jan 27, 2022, 21:55 UTC
- Message-ID
- <kl6lo83wzvv9.fsf@chooglen-macbookpro.roam.corp.google.com>
- In-Reply-To
- <patch-v4-7.7-02954603763-20220127T143552Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 35 quoted lines
> From: Atharva Raykar <raykar.ath@gmail.com> > > This patch completes the conversion past the flag parsing of > `submodule update` by introducing a helper subcommand called > `submodule--helper update`. The behaviour of `submodule update` should > remain the same after this patch. > > We add more fields to the `struct update_data` that are required by > `struct submodule_update_clone` to be able to perform a clone, when that > is needed to be done. > > Recursing on a submodule is done by calling a subprocess that launches > `submodule--helper update`, with a modified `--recursive-prefix` and > `--prefix` parameter. > > We also introduce `update_submodules2()` and `update_submodule2()` > which will supersede `update_submodules()` and `update_submodule()`. > > When the `--init` flag is passed to the subcommand, we do not spawn a > new subprocess and call `submodule--helper init` on the submodule paths, > because the Git machinery is not able to pick up the configuration > changes introduced by that init call[1]. So we instead run the > `init_submodule_cb()` callback over each submodule in the same process. > > While we are at it, we also remove the fetch_in_submodule() shell > function since it is no longer used anywhere. > > [1] https://lore.kernel.org/git/CAP8UFD0NCQ5w_3GtT_xHr35i7h8BuLX4UcHNY6VHPGREmDVObA@mail.gmail.com/ > > Mentored-by: Christian Couder <christian.couder@gmail.com> > Mentored-by: Shourya Shukla <periperidip@gmail.com> > Signed-off-by: Atharva Raykar <raykar.ath@gmail.com> > Signed-off-by: Junio C Hamano <gitster@pobox.com> > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> > ---
I've read through all of the patches besides this one - I hope to get through this one soon.
The diff is quite large, but I can't think of any way to shrink it down at the moment.