Skip to content

[Config] CMake: Shallow clone when using the git-fetch mechanism#5889

Merged
hugtalbot merged 5 commits intosofa-framework:masterfrom
fredroy:cmake_git_shallow
Feb 6, 2026
Merged

[Config] CMake: Shallow clone when using the git-fetch mechanism#5889
hugtalbot merged 5 commits intosofa-framework:masterfrom
fredroy:cmake_git_shallow

Conversation

@fredroy
Copy link
Contributor

@fredroy fredroy commented Jan 27, 2026

No need to retrieve the full repository on fetching IMO

Example with BeamAdapter:

  • full
git clone https://github.com/sofa-framework/BeamAdapter
...
Receiving objects: 100% (30388/30388), 44.09 MiB | 2.67 MiB/s, done.
  • shallow
git clone https://github.com/sofa-framework/BeamAdapter -depth 1
...
Receiving objects: 100% (248/248), 10.09 MiB | 8.03 MiB/s, done.

Some caveats from CMake though : https://gitlab.kitware.com/cmake/cmake/-/issues/17770 , depending if GIT_TAG is a branch, a ref or... a tag (🤪)

NOTE: shallow clone does not work if GIT_TAG is hash SHA reference to a commit so I needed some cmake function to test if the argument is a hash.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request labels Jan 27, 2026
@fredroy fredroy added the pr: enhancement About a possible enhancement label Jan 27, 2026
@hugtalbot hugtalbot requested a review from bakpaul January 27, 2026 15:00
@bakpaul
Copy link
Contributor

bakpaul commented Jan 30, 2026

The ci-dpends-on mechanism uses a commit hash. Could you please add a ci-depends-on to this PR to see if the cloning mechanism still works ?

@sofabot
Copy link
Collaborator

sofabot commented Jan 30, 2026

[ci-depends-on] detected during build #3.

To unlock the merge button, you must

@fredroy
Copy link
Contributor Author

fredroy commented Feb 2, 2026

The ci-dpends-on mechanism uses a commit hash. Could you please add a ci-depends-on to this PR to see if the cloning mechanism still works ?

it was already tested for commit hash, some of the dependencies of SofaImGui was using a hash for GIT_TAG (thats how I found the problem)

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Feb 5, 2026
@hugtalbot hugtalbot merged commit a9ae25d into sofa-framework:master Feb 6, 2026
12 of 13 checks passed
@hugtalbot hugtalbot deleted the cmake_git_shallow branch February 6, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: enhancement About a possible enhancement pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants