Is anyone using the new git super/subproject feature in real projects? How well does it work? For instance, I understand that if I push to a subproject I have to manually call superprojects hooks (maybe using the subprojects hook, but nevertheless)?
Is anyone using the new git super/subproject feature in real projects? How well does
Share
By using submodule, you are defining in your Git workspace (meaning your “super-project” Git repository) a configuration.
By “configuration”, I mean “the list of tags or SHA-1 node necessary to work in your workspace”.
(and by work, I mean whatever “development effort” you are doing within your workspace: classic compilation, or patch, or merge, or deployment, or…).
That is the case when your are cloning a super-project and “
git update” your submodules: you are checkouting the exact repos SHA1 which were previously committed in the super-project (recorded as gitlink in the index).The other mode is when you are working on your super-project and on one or more submodules.
That means, for a given submodules, you have checked out a specific branch (you are no longer using a detached HEAD for the content of that submodules, but rather a pointer to the tip of a branch).
Then, “pushing a submodule” means updating a distant repository containing that sub-module (and only that one).
The actual trick in that last scenario (which could deserve a hook of you want one) is when you are pushing the super-project: you need to be sure to have pushed all your sub-modules first.
From the submodule tutorial:
Don’t forget you can configure a submodule to follow a branch.