git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Jens.Lehmann@web.de, jrnieder@gmail.com,
	Stefan Beller <sbeller@google.com>
Subject: [PATCH 0/4] Submodule Groups
Date: Tue, 19 Jan 2016 19:34:36 -0800	[thread overview]
Message-ID: <1453260880-628-1-git-send-email-sbeller@google.com> (raw)

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

             reply	other threads:[~2016-01-20  3:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20  3:34 Stefan Beller [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453260880-628-1-git-send-email-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).