[Kde-scm-interest] git submodule

Thiago Macieira thiago at kde.org
Fri Sep 24 15:48:20 CEST 2010


Em Quinta-feira 23 Setembro 2010, às 21:32:12, Yury G. Kudryashov escreveu:
> No, with git-submodule you have a real git checkout of another project in
> a  subdirectory. It is just a "convenient" way to say which project should
> be checked out into given directory (like svn:external but less
> convenient). The main disadvantage of git-submodules is that git-clone is
> (yet?) unable to auto-clone all submodules (though it should not be hard
> to write a script that will do it).

That is not the disadvantage.

$ git clone |& grep submodules
    --recursive           initialize submodules in the clone

The disadvantage is that submodules were not created to be developed in. They 
are useful for pulling static dependencies that don't update often. For 
example, they are ideal for KDE 3's "admin" subdir. They can be used for 
sharing some private libraries between modules (libbtcore between KGet and 
KTorrent, oxygenhelper between the windeco and the style, etc.).

But they are really painful to use if you try to develop inside the submodule 
while developing on the supermodule as well. Every time you commit in the 
submodule, the supermodule marks the directory as "changed". So you're always 
prompted to commit in the supermodule.

If you try to change your checked out commit in any way (rebase, switch 
branches, bisect, etc.), the submodule changes along.

So, submodules are good for recreating the KDE modules *at* *release* *time*. 
That is, when a submodule releases, the supermodule updates. That's the only 
time they should record the change, or it will get really hairy.

That means that when you clone --recursive a KDE module, you get the latest 
released versions of each submodule. If you wish to move to the development 
version, you have to cd into the subdirectory and issue the appropriate update 
commands.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Qt Developer Days 2010  -  Munich Oct 11-13  -  San Francisco Nov 1-3
For more information and to register: http://qt.nokia.com/qtdevdays2010
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-scm-interest/attachments/20100924/d0f10667/attachment.sig 


More information about the Kde-scm-interest mailing list