From: Jens Lehmann <Jens.Lehmann@web.de>
To: Stefan Beller <sbeller@google.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
Jonathan Nieder <jrnieder@gmail.com>,
Johannes Schindelin <johannes.schindelin@gmail.com>,
Eric Sunshine <ericsunshine@gmail.com>,
Johannes Sixt <j6t@kdbg.org>, Heiko Voigt <hvoigt@hvoigt.net>
Subject: Re: [PATCH 5/5] builtin/clone: support submodule groups
Date: Wed, 25 Nov 2015 20:50:21 +0100 [thread overview]
Message-ID: <565610FD.9070303@web.de> (raw)
In-Reply-To: <CAGZ79kZrBRo9dfU=p8-bgvSpp=SSiXQHZGm7iCQ=9v0f_f_-aQ@mail.gmail.com>
Am 25.11.2015 um 19:08 schrieb Stefan Beller:
> On Wed, Nov 25, 2015 at 9:52 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
>>> +--group::
>>> + After the clone is created, all submodules which are part of the
>>> + group are cloned. This option can be given multiple times to
>>> specify
>>> + different groups.
>>
>>
>> Ah, that answers my question in my response to the cover letter ;-)
>>
>>> This option will imply automatic submodule
>>> + updates for the groups by setting `submodule.update=groups`.
>>
>>
>> Please don't. The per-submodule update setting configures how a
>> submodule has to be updated, adding a global one with a completely
>> different meaning (what submodules should be updated?) is confusing.
>> Why not "submodule.groups=<groups>"?
>
> The documentation is out of date :/ as I was churning through lots of ideas,
> so we do have a config submodule.groups=<groups> by now, but the
> documentation is wrong.
Thanks for explaining, I did not look at the code very closely so
far so I missed that.
>>
>>> + The group selection will be passed on recursively, i.e. if a
>>> submodule
>>> + is cloned because of group membership, its submodules will
>>> + be cloned according to group membership, too. If a submodule is
>>> + not cloned however, its submodules are not evaluated for group
>>> + membership.
>>
>>
>> What do you mean by the last sentence? Did the clone fail? Then you
>> cannot update the submodule anyway ...
>
> Consider nested submodules:
>
> A: superproject containing
> B: which contains
> C.
>
> If you clone A with group <C-but-not-B> you won't get C as we do not traverse
> the submodules of B, as we don't clone B. Maybe it's obvious?
Maybe yes. Everything about submodule C is configured in B's
.gitmodules file, not in A's. So you cannot find submodule C
in A's .gitmodules (and it thus cannot be in one of A's submodule
groups either). And if cloning B fails, you have no .gitmodules
file to get the URL of C to clone it from in the first place. So
I think the concept 'group <C-but-not-B>' doesn't make any sense
when C is a submodule of B.
>>> @@ -864,6 +876,21 @@ int cmd_clone(int argc, const char **argv, const char
>>> *prefix)
>>> option_no_checkout = 1;
>>> }
>>>
>>> + if (option_recursive && submodule_groups.nr > 0)
>>> + die(_("submodule groups and recursive flag are
>>> incompatible"));
>>
>>
>> Me thinks this contradicts your description of the --group option
>> in the man page. I don't see why such a restriction would make
>> sense, what incompatibility are you trying to avoid here? Maybe
>> we need another submodule-specific setting to tell update what
>> groups to use inside that submodule?
>
> So you want something like
> "In the top level respect the groups, but recursively get all of them"?
Nope, only those that are chosen by the groups.
> My thinking is that groups are implying recursive, whereas recursive implies
> "all groups", so a git clone --group <half-the-submodules> --recursive
> makes not much sense to me as it begs the question, what does --recursive
> mean?
Groups are only about what submodules to update and have nothing to
do with recursion. It might make sense to imply recursion, but that's
just because that should have been the default for submodules from day
one. Recursion and groups are orthogonal, the first is about what to
do inside the submodules (carry on or not?) and the latter is about
what to do in the superproject (shall I update this submodule?).
> Probably recurse into all submodules which are implied by the group
> <half-the-submodules>.
Yep. We also do not recurse into those submodules having set their
update setting to "none", so we do not do that for submodules not
in any chosen group either.
> And then get all the nested submodules. But in case
> you use the grouping feature, you could just mark the nested submodules with
> groups, too?
Not in the top superproject. In a submodule you can specify new groups
for its sub-submodules, but these will in most cases be different from
those of the superproject.
Imagine I have this really cool Metaproject which contains the Android
superproject as a submodule. Those two will define different groups,
and when recursing into the android submodule I need to choose from the
Android specific groups. So my Metaproject's .gitmodules could look like
this:
[submodule "android"]
path = android
url = git://...
groups = default,mobile
subgroups = devel
"groups" tells git what superproject groups the android submodule
belongs to, and "subgroups" tells git what android submodules are
to be checked out when running recursively into it. If you do not
configure "subgroups", the whole android submodule is updated when
one of the groups "default" or "mobile" is chosen in the superproject.
next prev parent reply other threads:[~2015-11-25 19:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 1:32 [RFC PATCH 0/5] Submodule Groups Stefan Beller
2015-11-25 1:32 ` [PATCH 1/5] submodule-config: keep submodule groups around Stefan Beller
2015-11-25 1:32 ` [PATCH 2/5] git submodule add can add a submodule with groups Stefan Beller
2015-11-25 1:32 ` [PATCH 3/5] git submodule init to pass on groups Stefan Beller
2015-11-25 1:32 ` [PATCH 4/5] submodule--helper: module_list and update-clone have --groups option Stefan Beller
2015-11-25 1:32 ` [PATCH 5/5] builtin/clone: support submodule groups Stefan Beller
2015-11-25 17:52 ` Jens Lehmann
2015-11-25 18:08 ` Stefan Beller
2015-11-25 19:50 ` Jens Lehmann [this message]
2015-11-25 20:03 ` Stefan Beller
2015-11-25 22:30 ` Jens Lehmann
2015-11-25 22:51 ` Stefan Beller
2015-11-26 0:31 ` [PATCHv2] " Stefan Beller
2015-11-26 0:33 ` Stefan Beller
2015-11-26 5:00 ` Trevor Saunders
2015-11-30 19:31 ` Stefan Beller
2015-12-01 6:53 ` Michael J Gruber
2015-12-01 18:58 ` Stefan Beller
2015-11-25 17:35 ` [RFC PATCH 0/5] Submodule Groups Jens Lehmann
2015-11-25 18:00 ` Stefan Beller
2015-11-25 19:18 ` Jens Lehmann
2015-11-30 23:54 ` Stefan Beller
2015-12-01 22:06 ` Jens Lehmann
2015-11-25 17:50 ` Jens Lehmann
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=565610FD.9070303@web.de \
--to=jens.lehmann@web.de \
--cc=ericsunshine@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.net \
--cc=j6t@kdbg.org \
--cc=johannes.schindelin@gmail.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
--cc=sbeller@google.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).