Been looking
https://www.pantsbuild.org/docs/using-pants-in-ci recently, particularly the "GitLab CI: disable shallow clones or fetch main branch" section.
⢠First, the code referenced there did not work out-of-the-box for me, which is fine. My company's custom shallow clone strategy in CI goes only to depth=5 which is sometimes not enough coverage for feature branches that have a long, unmerged commit history to them. So, I had to iteratively deepen with git fetch and test if git could find a merge-base. It's a bit gross.
⢠Second, there are two other options beyond full checkout and shallow clone: treeless git clones and blobless git clones.
See here for blog post. Both support arbitrary git merge-base but they can also
significantly reduce checkout times though not as much as the shallow clone. My testing with
pants --changed-since
seems to produce identical results in the treeless and blobless varieties.