View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013221CMakeCTestpublic2012-05-15 04:092012-10-01 13:23
ReporterZog Zog 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
Platformx86_64OSDebianOS VersionSqueeze
Product VersionCMake 2.8.8 
Target VersionFixed in Version 
Summary0013221: New submodules are not cloned when parent repository is Git Updated via CTest.
DescriptionWhen 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.
Steps To Reproduce- add a new submodule to a repository
- ctest_update() the repository
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0029473)
Brad King (manager)
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 (manager)
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 (reporter)
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 (manager)
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 (manager)
2012-10-01 13:23

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-05-15 04:09 Zog Zog New Issue
2012-05-15 10:01 Brad King Note Added: 0029473
2012-05-15 10:10 Brad King Note Added: 0029474
2012-05-16 04:24 Zog Zog Note Added: 0029478
2012-05-16 08:42 Brad King Note Added: 0029479
2012-05-16 08:44 Brad King Status new => resolved
2012-05-16 08:44 Brad King Resolution open => no change required
2012-10-01 13:23 David Cole Note Added: 0031129
2012-10-01 13:23 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team