Trying to understand the mechanics of submodules, I found it helpful to read this article explaining the detached-head concept in git:<br><br><a href="http://sitaramc.github.com/concepts/detached-head.html" target="_blank">http://sitaramc.github.com/concepts/detached-head.html</a><br>
<br>So in paraview:<br><br>$ cd ParaView<br>$ git submodule status VTK<br> 892014037f07ac668979c85b85112fc850515b94 VTK (v5.4.2-4331-g8920140)<br>$ cd VTK/<br>$ cat .git/HEAD<br>892014037f07ac668979c85b85112fc850515b94<br>
$ git checkout -b mywork<br>$ cat .git/HEAD<br>ref: refs/heads/mywork<br>$ cat .git/refs/heads/mywork<br>892014037f07ac668979c85b85112fc850515b94<br><br><br>Pat<br><br><div class="gmail_quote">On Wed, Apr 21, 2010 at 9:12 AM, Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Biddiscombe, John A. wrote:<br>
>> The matching Git commit is<br>
>><br>
>> <a href="http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=fddd6bba" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=fddd6bba</a><br>
><br>
> It seems like the sub modules have lives of their own.<br>
<br>
</div>Correct. I've been meaning to put more submodule documentation<br>
on the Wiki but haven't had time yet.<br>
<div><br>
> I'm working with paraview, and have a bunch of changes in<br>
> paraview : Xdmf : VTK<br>
> which are really their own repositories.<br>
<br>
</div>Oh, sorry, I didn't realize from your original email that it<br>
was more than just VTK.<br>
<div><br>
> Do I treat these as separate repos for the purposes of my<br>
> git management.<br>
<br>
</div>Yes, but they can be in one tree. See below.<br>
<div><br>
> Can I checkout paraview with a single tag and get all 3.<br>
<br>
</div>Yes:<br>
<br>
<a href="http://paraview.org/gitweb?p=ParaView.git;a=commit;h=c8805939" target="_blank">http://paraview.org/gitweb?p=ParaView.git;a=commit;h=c8805939</a><br>
<br>
$ git checkout -b mypv c8805939<br>
$ git submodule update<br>
<div><br>
> Basically, can I do all in one, or must I do 3<br>
<br>
</div>The above command will give you a tree with<br>
<br>
.git/ = ParaView clone<br>
VTK/.git/ = VTK clone<br>
Utilities/IceT/.git/ = IceT clone<br>
Utilities/Xdmf2/.git/ = Xdmf clone<br>
<br>
The local ParaView will be on the "mypv" branch created<br>
by the checkout command (the name is arbitrary). The other<br>
submodule repositories will be in a "detached HEAD" state.<br>
This means that their work trees have been checked out as<br>
the versions specified by ParaView's submodule references<br>
as of c8805939. These should match the last cvs versions<br>
for all of the projects.<br>
<br>
Then you can go into each submodule repo and create a local<br>
branch on which to put your commits. The local branches<br>
will automatically start from the current versions, which<br>
is what you want:<br>
<br>
$ cd VTK<br>
$ git checkout -b myvtk<br>
$ cd ../Utilities/Xdmf2<br>
$ git checkout -b myxdmf<br>
<br>
Next, apply your patches from CVS to the whole ParaView<br>
tree. Then go into each submodule and create their commits.<br>
When finished with all the submodules, run "git status"<br>
at the top level of ParaView. It should report that the<br>
submodules have been modified. This means that their<br>
HEAD points at a different version than that referenced<br>
by ParaView. Use "git add" to stage the new references.<br>
Then add the rest of your changes in ParaView and commit.<br>
<div><div></div><div><br>
-Brad<br>
_______________________________________________<br>
Paraview-developers mailing list<br>
<a href="mailto:Paraview-developers@paraview.org" target="_blank">Paraview-developers@paraview.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
</div></div></blockquote></div><br>