siemens / kas

Setup tool for bitbake based projects
MIT License
339 stars 145 forks source link

repos: Add KAS_GIT_SHALLOW to implement git shallow clone/fetch #105

Closed marex closed 1 month ago

marex commented 8 months ago

Add new environment variable KAS_GIT_SHALLOW which adds '--depth=N' to the 'git clone' and 'git fetch' commands. This forces git to perform shallow clone, which saves bandwidth and CI runner disk space. The depth 'N' is derived from KAS_GIT_SHALLOW value.

This is useful in case CI always starts with empty work directory and this directory is always discarded after the CI run. In that case, it makes no sense to clone the entire repository, instead clone just enough to reproduce the desired state of the repository and assemble the checkout of it.

This is also useful when cloning massive repositories which would otherwise take long time to clone.

jan-kiszka commented 8 months ago

Hi Marek, could you also submit this as patch to the mailing list?

jan-kiszka commented 4 months ago

Any follow-ups planned?

chriswiggins commented 2 months ago

Any update on this? This would be really handy for us, cloning openembedded at the moment is extremely slow

fmoessbauer commented 2 months ago

Any update on this? This would be really handy for us, cloning openembedded at the moment is extremely slow

I took over, adapted the patch and sent it to the ML. All of you (@marex , @chriswiggins ) are in CC.

To get things integrated in a more timely manner, it helps to stick to the ML workflow (described in the contribution guide).

jan-kiszka commented 1 month ago

Now available upstream.