git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/4] Submodule Groups
@ 2016-01-20  3:34 Stefan Beller
  2016-01-20  3:34 ` [PATCH 1/4] git submodule: Teach add to accept --group Stefan Beller
                   ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Stefan Beller @ 2016-01-20  3:34 UTC (permalink / raw)
  To: git, gitster; +Cc: Jens.Lehmann, jrnieder, Stefan Beller

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(-)

-- 
2.7.0.rc0.41.g89994f2.dirty

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2016-01-22  8:55 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20  3:34 [PATCH 0/4] Submodule Groups Stefan Beller
2016-01-20  3:34 ` [PATCH 1/4] git submodule: Teach add to accept --group Stefan Beller
2016-01-20 21:18   ` Junio C Hamano
2016-01-20 23:57     ` Stefan Beller
2016-01-21  0:08       ` Junio C Hamano
2016-01-21  0:16         ` Stefan Beller
2016-01-21  4:45           ` Junio C Hamano
2016-01-20  3:34 ` [PATCH 2/4] submodule-config: keep groups around Stefan Beller
2016-01-20 21:23   ` Junio C Hamano
2016-01-21  0:20     ` Stefan Beller
2016-01-21  2:37       ` Junio C Hamano
2016-01-20  3:34 ` [PATCH 3/4] submodule update: Initialize all group-selected submodules by default Stefan Beller
2016-01-20 21:30   ` Junio C Hamano
2016-01-21  1:44     ` Stefan Beller
2016-01-21  4:40       ` Junio C Hamano
2016-01-21 19:39         ` Stefan Beller
2016-01-21 20:47           ` Junio C Hamano
2016-01-21 20:57             ` Junio C Hamano
2016-01-20  3:34 ` [PATCH 4/4] builtin/clone: support submodule groups Stefan Beller
2016-01-20 21:43   ` Junio C Hamano
2016-01-21 21:17 ` [PATCH 0/4] Submodule Groups Sebastian Schuberth
2016-01-21 21:56   ` Stefan Beller
2016-01-21 22:18     ` Junio C Hamano
2016-01-21 22:25       ` Junio C Hamano
2016-01-21 22:30       ` Stefan Beller
2016-01-21 22:37         ` Junio C Hamano
2016-01-22  8:55     ` Sebastian Schuberth

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).