[Insight-developers] FEM framework and Testing/Data (was: Modular ITK Git Question)

Brad King brad.king at kitware.com
Wed Apr 6 16:01:23 EDT 2011


On 04/06/2011 02:24 PM, Magnotta, Vincent A wrote:
> I am working on integrating our FEM changes into modular ITK. This is
> currently housed on github (git at github.com:vmagnotta/ITKFEM-Modular.git).

For reference, one may browse your repositories here:

  https://github.com/vmagnotta/ITKFEM-Modular
  https://github.com/vmagnotta/ITKV4FEM-ModularData

Thanks for working on this.  Here are a few general comments:

- The "UPD: " prefix in your commit messages does not follow our rules.
  Please follow the instructions at http://www.itk.org/Wiki/ITK/Git/Develop
  to get started with development.  The SetupForDevelopment.sh installs
  a local hook which would have caught this and given you a message
  describing the possible prefixes.

- Why this commit: Moved FEM from Numerics to Core
  https://github.com/vmagnotta/ITKFEM-Modular/commit/5b8675e5 ?
  Finite elements seem pretty numerical to me.  The directory structure
  and grouping is for human reference.  It is independent of module
  dependencies.

- The modifications to Modules/ThirdParty/MetaIO/src/MetaIO cannot be
  committed upstream through Git.  That directory is replayed from a
  Subversion repository by a robot.  We can deal with that when you
  submit the series for review though.  It will be easier if you keep
  commits to this directory separate from the others.

- The Testing/Data update commit
  https://github.com/vmagnotta/ITKFEM-Modular/commit/753cbf26
  updates the submodule reference to f93daefd but I do not see
  that commit in your data repository.  Perhaps that is the purpose
  of your posted question though ;)

> I have all of the FEM
> framework changes made for an initial integration and have added a
> number of files for regression testing. This brings me to my question.

I've been so busy with the modularization transition that I have not had
time to get back to fixing up the way we reference testing data to avoid
submodules but still not put it in the source tree.

> I would now like to link the Testing/Data to this new Data repository
> instead of the default ITK testing data. Would any one have a suggestion
> on how to do this?

The Testing/Data link only names a commit hash from another repository:

 $ git ls-tree -r HEAD -- Testing/Data
 160000 commit 9e3b3ef32e5fcae1dc54d80534c8dab24248a9d6  Testing/Data

This does not give Git enough information to actually fetch the commit.
Instead, one must configure the repository from which to fetch the data.
This starts with the ".gitmodules" file at the top of the tree:

 $ git show HEAD:.gitmodules
 [submodule "Testing/Data"]
         path = Testing/Data
         url = git://itk.org/ITKData.git

However, the url in there is not used directly.  The "git submodule init"
command copies it into the local repository's configuration:

 $ git config submodule.Testing/Data.url
 git://itk.org/ITKData.git

It is this URL from which Git fetches during "git submodule update".
You can change it in a local clone:

 $ git config submodule.Testing/Data.url git://github.com/...

However, that doesn't actually matter for this use case.

What you need to do is ensure that Testing/Data in your branch of ITK
points at the right commit in your branch of ITKData:

 $ cd Testing/Data
 $ git checkout $commit_you_want
 $ cd ..
 $ git add Testing/Data
 $ git commit

Then make sure both branch heads are published in your github forks.
During review you can push only the ITK part to Gerrit.  Then add a
note to the review page that mentions the URL of your data repository.
Then a reviewer may do this to get it:

 $ cd ITK
 $ git fetch gerrit $your_change && git checkout FETCH_HEAD
 $ cd Testing/Data
 $ git fetch $your_data_url
 $ cd ../..
 $ git submodule update

-Brad


More information about the Insight-developers mailing list