Pull request #185
closedchecking out git repo with the dir format: don't symlink .git, and use a gitdir instead
Description
Hi,
Since https://github.com/jrl-umi3218/jrl-cmakemodules/pull/162 we need to have a working `git describe` command available when we build our packages.
In our current CI process, we use `make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"` in gitlab-CI with robotpkg, but this break git (it doesn't consider robotpkg/$category/$packages/work.$hostname/$distname/.git as a valid git directory, and use robotpkg/.git instead)
https://github.com/nim65s/robotpkg/commit/c2dad40d97fad411bac2668127f78f04115d61b2 fixes the issue by avoiding symlink of .git/ files, and instructs git to use the already available $extract_dir/.git instead
Here are tests:
- without this commit https://gepgitlab.laas.fr/gsaurel/pinocchio/-/jobs/8350
- with this commit https://gepgitlab.laas.fr/gsaurel/pinocchio/-/jobs/8349
This has the advantage of speeding up a bit the checkout, as the .git/ folder contains a lot of files, and a few limitations:
- git submodules are available, but without their .git configuration file
- if $extract_dir/.git is already a file containing the gitrepo instruction instead of a regular .git directory, it will not work
- if someone use a .git file or directory for something else than git, it will not work
For the records, I also tried to set the GIT_DIR environment variable to $CI_PROJECT_DIR/.git, and it worked for the `git describe`, but the build failed: https://gepgitlab.laas.fr/gsaurel/pinocchio/-/jobs/8346
In addition, I think that we should update the cmake submodule to avoid failing that much if `git describe` is not working, but on the other hand it yould be nice to have it when we generate the documentation, as it is also used by doxygen. Right now, http://projects.laas.fr/gepetto/doc/stack-of-tasks/pinocchio/master/doxygen-html/ displays a big `UNKNOWN` instead of a pretty version tag, which would be much more useful.