On Tue, Apr 17, 2018 at 1:35 PM, Mikael Persson <
rabar...@gmail.com> wrote:
>
>
> Den torsdag 12 april 2018 kl. 02:04:45 UTC+2 skrev Stefan Beller:
>>
>> Hi Mikael,
>>
>> thanks for trying out submodules!
>>
>> On Wed, Apr 11, 2018 at 1:36 PM, Mikael Persson <
rabar...@gmail.com>
>> wrote:
>> > Thanks Gareth and Nicholas for feedback!
>> > I was slightly aware of the git submodules feature but I have never used
>> > it
>> > in practise. I have now played around with it a bit
>> > and indeed it is quite similar to a manifest (repo or in my tool grit) -
>> > in
>> > "simple" scenarios at least.
>> >
>> > I see benefits with an explicit manifest though:
>> > * Possibility to add additional metadata to each repo (both standard git
>> > options missing in submodule, but also things like groups).
>>
>> You can add additional metadata to it, see
>>
https://git-scm.com/docs/gitmodules for some features.
>
> Can you add your own metadata as well (similar to "x-" in grit)? In my
> experience, the most common usage
> is license info, to keep track of all code licenses in a project.
You can add any metadata to it using the git config file format.
> Looking at the link I mainly miss the ability to set group memberships (in
> the repo meaning) and single-branch.
group memberships can be done via git attributes, and then
git clone --recurse-submodules=:(attr:default,my-group)
The single-branch is just a missing piece we'll have to look into
> Groups are quite handy when you work within a domain in a larger system,
> e.g. I would like to do things like
> "grit -g camera checkout -b mybranch" to checkout mybranch on all camera
> gits.
In a submodule world you can configure the active submodules via
submodule.active, which again takes a pathspec, including grouping
by git attributes.
>> > * With the possibility to overlay manifests, you can more easily handle
>> > more
>> > complicated setups (see CONFIGS.md).
>>
>> Can you talk more about that?
>
> I spend some more time adding examples at:
>
https://github.com/rabarberpie/grit/blob/master/CONFIGS.md
> The fundamental approach in grit is that shared git settings/parameters
> (among repositories), like remote name and URL, are placed in profiles. And
> profiles can inherit from other profiles to further encapsulate common
> settings, like branch name. In this way, there is essentially no duplication
> of information in the manifest and with properly defined profiles, you can
> easily change settings for all, or a subset, of the repositories.
>
> But even above is not always sufficient. The possibility to overlay manifest
> enables you to share common manifest files into different combinations (see
> the link above for example use-cases). Overlaying is more powerful than
> include (like repo has), since it can not only add things, but also modify
> or remove things.
Thanks!
Stefan