Submodule Groups
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 22 repliesIn review
Changes in v1 from the cover letter
=============
* All entries are stored as separate lines (both in .git/config as well as in the .gitmodules file)
* No harm is done to init as it is implied by update now. :)
* I tried to keep it as simple as possible (update and clone being the minimal set of supported commands required, add --group being syntactic sugar for editing the .gitmodules file.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | git submodule: Teach add to accept --groupDocumentation/ git-submodule.sh t/ | +54 | 5 replies | |
| 2/4 | submodule-config: keep groups aroundsubmodule-config.c submodule-config.h | +14 | 3 replies | |
| 3/4 | submodule update: Initialize all group-selected submodules by defaultbuiltin/ t/ | +55 | 6 replies | |
| 4/4 | builtin/clone: support submodule groupsDocumentation/ builtin/ t/ | +110 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] Submodule Groups
This applies on top of the updated sb/submodule-init branch.
Why?
====
Consider having a real large software project in Git with each component in a submodule (such as an operating system, Android, Debian, Fedora, no toy OS such as https://github.com/gittup/gittup as that doesn't quite demonstrate the scale of the problem).
If you have lots of submodules, you probably don't need all of them at once, but you have functional units. Some submodules are absolutely required, some are optional and only for very specific purposes.
This patch series adds meaning to a "groups" field in the .gitmodules file.
So you could have a .gitmodules file such as:
[submodule "gcc"]
path = gcc
url = git://...
groups = default
groups = devel
[submodule "linux"]
path = linux
url = git://...
groups = default
[submodule "nethack"]
path = nethack
url = git://...
groups = optional
groups = games
and by this series you can work on an arbitrary subgroup of these submodules such using these commands:
git submodule add --group default --group devel git://... .. # will add a submodule, adding 2 submodule
# groups to its entry in .gitmodule (default and devel)
git submodule update --groups
# All submodules as selected by groups (submodule.groups in .git/config) # will be initialized if they are not, before updating.
git clone --group default,default2 --group devel git://...
# will clone the superproject and recursively
# checkout any submodule being in at least one of the groups (default, default2, devel)
Changes to v1
=============
* All entries are stored as separate lines (both in .git/config as well as in the .gitmodules file)
* No harm is done to init as it is implied by update now. :)
* I tried to keep it as simple as possible (update and clone being the minimal set of supported commands required, add --group being syntactic sugar for editing the .gitmodules file.
This is also available at https://github.com/stefanbeller/git/tree/submodule-groups-v2
Thanks,
Stefan
Stefan Beller (4):
git submodule: Teach add to accept --group
submodule-config: keep groups around
submodule update: Initialize all group-selected submodules by default builtin/clone: support submodule groups
Documentation/git-clone.txt | 13 +++++ Documentation/git-submodule.txt | 8 ++- builtin/clone.c | 46 +++++++++++++++-- builtin/submodule--helper.c | 30 ++++++++++- git-submodule.sh | 15 ++++++ submodule-config.c | 13 +++++ submodule-config.h | 1 + t/t7400-submodule-basic.sh | 112 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 233 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.0.rc0.41.g89994f2.dirty