Git submodules

David Edmundson david at davidedmundson.co.uk
Sun Oct 9 23:42:02 UTC 2011


On Sun, Oct 9, 2011 at 9:14 PM, David Edmundson
<david at davidedmundson.co.uk> wrote:
> I tried updating the contact list to use the git submodule
> telepathy-common-internals
>
> It mostly went smoothly but I have two issues:
>
> If I ship as-is people need to run "git submodule init" "git submodule
> update" before their code will compile.
>
> I tried adding it into CMakeFiles.txt as
> execute_process(COMMAND git update blah blah blah WORKING_DIRECTORY
> ${CMAKE_SRC_DIR} )
>
> This works, but only when they run cmake twice, the first time it
> errors that the cpp files (from the submodule) aren't there before
> running my execute line. The second time it's fine.
> No idea why.
>
> Also - it's going to completely break making tarballs.
> I assume it makes sense for the tarballs to have the code for the git
> sub-repo in part of the tarball. This means my cmake line to run "git
> submodule init" etc. will break everything.
>
> I'm not sure how to do this in a way that's nice for normal users, and
> isn't going to make every packager want to murder me.
>
> Dave
>

Update:

Spoke to George K and came up with a plan between us. The
CMakeLists.txt file only updates git submodules if the file
".gitmodules" is present. When building tarballs the submodule
contents will be fetched, and this .gitmodules file should be removed
as it makes no sense when not in git mode.

Could someone review my moving changes in my scratch repo at. It's not
really a sensible patch for RB as it's a lot of moving about.
git://anongit.kde.org/scratch/davidedmundson/telepathy-contact-list
master branch

I'd be interested to hear from alin (or another packager) to know that
everything still behaves correctly.

Dave


More information about the KDE-Telepathy mailing list