Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly checkouting git submodules in a given repo #46

Open
nunoguedelha opened this issue Jan 30, 2020 · 3 comments
Open

Properly checkouting git submodules in a given repo #46

nunoguedelha opened this issue Jan 30, 2020 · 3 comments
Labels
question Further information is requested

Comments

@nunoguedelha
Copy link

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):

  • if we checkout the branch master (commit 6fb6db9), the respective commit value for the submodule lin_sys/direct/qdldl/qdldl_sources is 12d56ee (tag v0.1.4).
  • if we checkout the tag v0.6.0 (commit 0baddd3), the respective commit value for the submodule lin_sys/direct/qdldl/qdldl_sources should be 70596af (commit message Merge pull request #22 ...), but in fact, the actual commit checked out in the submodule stays the same: 12d56ee (tag v0.1.4). This "discrepancy" then appears as a change in the working tree of the parent repo osqp:
$ git status
HEAD detached at v0.6.0
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   lin_sys/direct/qdldl/qdldl_sources (new commits)

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
Copy link
Member

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.

@GiulioRomualdi GiulioRomualdi added the question Further information is requested label Jan 30, 2020
@nunoguedelha
Copy link
Author

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

@nunoguedelha
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants