Add GIT_LFS_PULL_FLAGS variable to pass flags to git lfs pull

What does this MR do?

Add GIT_LFS_PULL_FLAGS variable to pass flags to git lfs pull

Allow jobs to limit which Git LFS objects are fetched during get_sources, e.g. GIT_LFS_PULL_FLAGS="--include=*.bin --exclude=large/**". The flags are appended to git lfs pull for the main repository and for submodules, in both the shell script writer and the function stages. As with the other GIT_*_FLAGS variables, "none" clears the flags.

Why was this MR needed?

consider having to test compression-libraries: you might have LFS-files, that are only needed on very specific jobs (test larg decompressions). This would slow down all other jobs with LFS.

What's the best way to test this MR?

  1. Use a project with Git LFS files in more than one directory, for example files/lfs/ and other-lfs/.
  2. Run a job with GIT_LFS_PULL_FLAGS: "--exclude=other-lfs/**". Files under other-lfs/ stay as LFS pointer files, and the others are downloaded.
  3. Run it again with GIT_LFS_PULL_FLAGS: "none" or without the variable. All LFS files are downloaded.
  4. With GIT_SUBMODULE_STRATEGY: recursive, the same flags apply to git lfs pull in each submodule.

What are the relevant issue numbers?

Related to gitlab#24590 (closed)

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

Edited by Felix Bühler

Merge request reports

Loading
Loading