Can a user defined GIT_STRATEGY be defined; How to customize git interface?

  • I would like to be able to use a git SPARSE clone with SPARSE checkout when using gitlab pipelines.
    More generally, is it possible to define a custom ‘class’ or that configures how GitLab handles getting code from the GIT repositories?

  • I am coming at this from the perspective of declarative Jenkins pipelines where one can define a custom subclass (in a shared pipeline library) of the git checkout step and get full and complete control over how the source code is acquired.

  • I want to be able to use the following ‘skeleton’ to acquire the source code from a (custom) mono-repository (via a SPARSE clone no blobs and a SPARSE checkout giving the paths in the repository to checkout)

git clone --filter=blob:none [url] [reference] [local path]
git sparse-checkout init
git sparse-checkout set [path(s) in repository to checkout]