MantisBT - CMake
View Issue Details
0013221CMakeCTestpublic2012-05-15 04:092012-10-01 13:23
Zog Zog 
 
normalmajoralways
closedno change required 
x86_64DebianSqueeze
CMake 2.8.8 
 
0013221: New submodules are not cloned when parent repository is Git Updated via CTest.
When a new submodule is added to a repository, the "ctest_update" command in a CTest script does not initialize the new submodule.

So, I modified CTest/cmCTestGIT.cxx and changed cmCTestGIT::UpdateImpl() :

< char const* git_submodule[] = {git,"submodule", "update", recursive, 0};
> char const* git_submodule[] = {git,"submodule", "update", "--init", recursive, 0};

There surely is a cleaner way to do this, I suppose.
- add a new submodule to a repository
- ctest_update() the repository
No tags attached.
Issue History
2012-05-15 04:09Zog ZogNew Issue
2012-05-15 10:01Brad KingNote Added: 0029473
2012-05-15 10:10Brad KingNote Added: 0029474
2012-05-16 04:24Zog ZogNote Added: 0029478
2012-05-16 08:42Brad KingNote Added: 0029479
2012-05-16 08:44Brad KingStatusnew => resolved
2012-05-16 08:44Brad KingResolutionopen => no change required
2012-10-01 13:23David ColeNote Added: 0031129
2012-10-01 13:23David ColeStatusresolved => closed

Notes
(0029473)
Brad King   
2012-05-15 10:01   
For reference, the submodule update --init option was added in Git 1.5.6:

 http://repo.or.cz/w/git.git/commitdiff/be4d2c83 [^]
(0029474)
Brad King   
2012-05-15 10:10   
CTest never runs "git submodule init" in the first place. It takes no responsibility to choose which submodules the user wants checked out. Not all use cases want all submodules to be present. CTest cannot force use of all submodules on everyone. This would need to be made an optional feature.

Meanwhile, one can simply use execute_process to run "git submodule update --init" after ctest_update. Since the list of changes ctest_update reports does not recurse into submodules anyway it does not matter if new submodules are checked out afterward.
(0029478)
Zog Zog   
2012-05-16 04:24   
Ok, so it's not a bug after all.
By the way, is it possible ctest_update lists changes into submodules, or why it is not ?
(0029479)
Brad King   
2012-05-16 08:42   
Re 0013221:0029478: ctest_update just reports the changes that plumbing commands like "git diff-tree" report for each commit between the version prior to update and the version after update. The commit hashes are reported for use by CDash which generates links to web viewers for the corresponding repository. Listing changes inside submodules would reference commits that do not exist in the main repo. Also again they are not of interest for all use cases.

If the details of the history in the submodule are of great importance to the outer project consider using Git's subtree merge feature instead.
(0031129)
David Cole   
2012-10-01 13:23   
Closing resolved issues that have not been updated in more than 4 months.