Re: [PATCH] submodule: implement `module_name` as a builtin helper
- From
Stefan Beller <sbeller@google.com>
- Date
- Aug 7, 2015, 20:49 UTC
- Message-ID
- <CAGZ79kYtCgYRHuMcxNoi6f9+GYYYCq6aRTdvx4ZKELSuQErkVQ@mail.gmail.com>
- In-Reply-To
- <xmqqlhdmyhtt.fsf@gitster.dls.corp.google.com>
On Fri, Aug 7, 2015 at 1:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
> Jens Lehmann <Jens.Lehmann@web.de> writes: > > This change... > >>> @@ -723,10 +733,8 @@ int fetch_populated_submodules(const struct argv_array *options, >>> if (!S_ISGITLINK(ce->ce_mode)) >>> continue; >>> >>> - name = ce->name; >>> - name_for_path = unsorted_string_list_lookup(&config_name_for_path, ce->name); >>> - if (name_for_path) >>> - name = name_for_path->util; >>> + name_for_path = submodule_name_for_path(ce->name); >>> + name = name_for_path ? name_for_path : ce->name; > > ... interacts with Heiko's cached submodule config work that seems > to have stalled.
We can drop that hunk as it only uses the new method `submodule_name_for_path` but doesn't change functionality. So if you want to keep Heikos work, I'll just resend the patch without that hunk.
Show 7 quoted lines
> > I can discard the stalled topic and queue this one instead, asking > Heiko to reroll his on top once this has stabilized, or if Stefan is > really into revamping submodule now (which I hope is the case), > perhaps Heiko's work can be rerolled by Stefan (with help from > others, of course) as a prerequisite and then these changes can be > built on top of it?
I am a bit overwhelmed as I am into git submodule for a few days now and still have not a full&good understanding of the details. So for now my plan looks like this:
1) rewrite the helpers in C (module_list, module_name and module_clone) These helper functions are useful for themselves as they speed up git submodule operations, but I have them on the plan as they are a pre requisite for rewriting `git submodule update`
2) Come up with a good thread pool abstraction (Started as "[RFC/PATCH 0/4] parallel fetch for submodules" ) This abstraction (if done right) will allow us to use it in different places easily. I started it as part of "git fetch --recurse-submodules" because it is submodule related and reasonably sized
3) Rewrite `git submodule update` in C This will start out as a literal translation and once 2 is coming along nicely, I want to add that thread pool capability to the C rewrite.
This plan still is huge to me, but a lot smaller than my initial "rewrite the whole git-submodule.sh in C".
Once the rewrite and parallelism is done, I may want to start adding new features to the submodules, such as different "classes". Currently I think each submodule would have a set of these classes or features, such that you could clone a superproject with hints on the classes:
git clone <url-to-super-project> --submodule-flags=basis,amiga-specific,ui
each of the flags would then include a specifc set of submodules, such that after cloning the super project you have everything you need to build the program with ui on amiga.
>