robotology / osqp-eigen

Simple Eigen-C++ wrapper for OSQP library
https://robotology.github.io/osqp-eigen/
BSD 3-Clause "New" or "Revised" License
393 stars 117 forks source link

Properly checkouting git submodules in a given repo #46

Open nunoguedelha opened 4 years ago

nunoguedelha commented 4 years ago

This is is not to point out a real issue, but more a heads up and to verify with you, @GiulioRomualdi , @traversaro , that we are doing the same thing when selecting a given commit of a repo containing git submodules. Let's consider the example of https://github.com/oxfordcontrol/osqp.git (I open the issue here because of osqp being an external repo obviously):

no changes added to commit (use "git add" and/or "git commit -a")



So in order to select the real `osqp` version `v0.6.0`, we also have to checkout `70596af` (commit message `Merge pull request #22 ...`) in the submodule.

Is this what we are doing when evaluating/selecting the desired versions of `osqp`?
traversaro commented 4 years ago

Is this what we are doing when evaluating/selecting the desired versions of osqp?

I am not really sure what CMake's ExternalProject does internally, but at least for the robotology-superbuild on a clean build (so no subsequent tag changes), it seems that the correct version of qdldl is used.

nunoguedelha commented 4 years ago

So there would be a problem only if we first clone master then checkout an earlier commit. I get it.

nunoguedelha commented 4 years ago

As a side note, git submodule update --recursive will checkout the proper commit of the submodule. I was reading this tutorial: https://git-scm.com/book/en/v2/Git-Tools-Submodules.