trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: February 2012

Re: [trinity-devel] git clone - not cloning contents of submodules (cmake, admin, ...)

From: "David C. Rankin" <drankinatty@...>
Date: Thu, 16 Feb 2012 13:00:00 -0600
On 02/16/2012 11:41 AM, David C. Rankin wrote:
> One of the primary problems seems to be the creation of '.git' FILES instead of
> '.git' DIRECTORIES on checkout:
>
> 11:37 archangel:/dat_f/tde>  find main -type f -name .git
> main/tdegraphics/.git
> main/tdeartwork/.git
> main/tdepim/.git
> main/libraries/libkexiv2/.git
> main/libraries/libksquirrel/.git
> main/libraries/mlt/.git
> main/libraries/pytdeextensions/.git
> main/libraries/libkdcraw/.git
> main/libraries/libkipi/.git

   I have identified the source of the problem, but I do NOT know what is 
causing it yet. The problem is .git FILES are being created by 
switch_all_submodules_to_head_and_clean. If I run:

cd tde
find . -type f -name .git -exec rm '{}' \;

and then run

./scripts/switch_all_submodules_to_head_and_clean

all of the .git files are re-created and the 'admin' and 'cmake' files for the 
apps that have .git files are not populated with the shared data. eg:

12:51 archangel:/dat_f/tde> l main/dependencies/tqtinterface/
total 108
drwxr-xr-x  5 david david  4096 Feb 16 11:54 .
drwxr-xr-x 14 david david  4096 Feb  8 17:37 ..
drwxr-xr-x  2 david david  4096 Feb  8 18:47 admin
drwxr-xr-x  2 david david  4096 Feb  8 18:47 cmake
drwxr-xr-x  6 david david  4096 Feb 16 11:54 qtinterface
-rw-r--r--  1 david david    61 Feb 16 11:54 .git
-rw-r--r--  1 david david   206 Feb 16 11:54 .gitmodules
-rw-r--r--  1 david david    70 Feb 16 11:54 AUTHORS
-rw-r--r--  1 david david  1236 Feb 16 11:54 CMakeLists.txt
-rw-r--r--  1 david david 18277 Feb 16 11:54 COPYING
-rw-r--r--  1 david david  7265 Feb 16 11:54 ConfigureChecks.cmake
-rw-r--r--  1 david david  1375 Feb 16 11:54 Makefile.am.in
-rw-r--r--  1 david david   661 Feb 16 11:54 NAMING
-rw-r--r--  1 david david  5968 Feb 16 11:54 README
-rw-r--r--  1 david david    11 Feb 16 11:54 TODO
-rw-r--r--  1 david david    74 Feb 16 11:54 configure.in.bot
-rw-r--r--  1 david david 10611 Feb 16 11:54 configure.in.in
-rw-r--r--  1 david david   319 Feb 16 11:54 configure.in.mid
-rw-r--r--  1 david david   387 Feb 16 11:54 tqtinterface.lsm


   If on the other hand I remove and clone a specific module itself, then I 
get a proper .git directory:

12:53 archangel:/dat_f/tde/main/dependencies> rm -r tqtinterface/
12:54 archangel:/dat_f/tde/main/dependencies> git clone 
http://drankin@.../scm/git/tqtinterface
Cloning into 'tqtinterface'...
remote: Counting objects: 4579, done
remote: Finding sources: 100% (4579/4579)
remote: Total 4579 (delta 3951), reused 4579 (delta 3951)
Receiving objects: 100% (4579/4579), 1.55 MiB | 96 KiB/s, done.
Resolving deltas: 100% (3951/3951), done.
12:54 archangel:/dat_f/tde/main/dependencies> l tqtinterface/
total 108
drwxr-xr-x  6 david david  4096 Feb 16 12:54 .
drwxr-xr-x 14 david david  4096 Feb 16 12:54 ..
drwxr-xr-x  8 david david  4096 Feb 16 12:54 .git
drwxr-xr-x  2 david david  4096 Feb 16 12:54 admin
drwxr-xr-x  2 david david  4096 Feb 16 12:54 cmake
drwxr-xr-x  6 david david  4096 Feb 16 12:54 qtinterface
-rw-r--r--  1 david david   206 Feb 16 12:54 .gitmodules
-rw-r--r--  1 david david    70 Feb 16 12:54 AUTHORS
-rw-r--r--  1 david david  1236 Feb 16 12:54 CMakeLists.txt
-rw-r--r--  1 david david 18277 Feb 16 12:54 COPYING
-rw-r--r--  1 david david  7265 Feb 16 12:54 ConfigureChecks.cmake
-rw-r--r--  1 david david  1375 Feb 16 12:54 Makefile.am.in
-rw-r--r--  1 david david   661 Feb 16 12:54 NAMING
-rw-r--r--  1 david david  5968 Feb 16 12:54 README
-rw-r--r--  1 david david    11 Feb 16 12:54 TODO
-rw-r--r--  1 david david    74 Feb 16 12:54 configure.in.bot
-rw-r--r--  1 david david 10611 Feb 16 12:54 configure.in.in
-rw-r--r--  1 david david   319 Feb 16 12:54 configure.in.mid
-rw-r--r--  1 david david   387 Feb 16 12:54 tqtinterface.lsm

   Then running switch_all_submodules_to_head_and_clean will pull in the 
submodule information (in this case abakus -- it is done first in the script), 
but fails on the next module with a .git FILE instead of a DIR.

Entering 'experimental'
Preparing /dat_f/tde/experimental for development use
HEAD is now at 61616ea Update autoconversion script
Already up-to-date.
HEAD is now at 61616ea Update autoconversion script
Entering 'main/applications/abakus'
Preparing /dat_f/tde/main/applications/abakus for development use
HEAD is now at 9d4c1cd Reset submodule main/applications/abakus/admin to 
latest HEAD
Already up-to-date.
HEAD is now at 9d4c1cd Reset submodule main/applications/abakus/admin to 
latest HEAD
Submodule 'admin' () registered for path 'admin'
Submodule 'cmake' () registered for path 'cmake'
Entering 'admin'
Already on 'master'
Entering 'cmake'
Already on 'master'
Entering 'admin'
Already up-to-date.
Entering 'cmake'
Already up-to-date.
Entering 'admin'
This script can only be run from a top level git directory.  Exiting...
Stopping at 'admin'; script returned non-zero status.
Entering 'main/applications/adept'
This script can only be run from a top level git directory.  Exiting...
Stopping at 'main/applications/adept'; script returned non-zero status.

   I'll leave this one to the git experts, I'm just chasing my tail...

-- 
David C. Rankin, J.D.,P.E.