kas icon indicating copy to clipboard operation
kas copied to clipboard

repos: Add KAS_GIT_SHALLOW to implement git shallow clone/fetch

Open marex opened this issue 2 years ago • 2 comments

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.

marex avatar Oct 28 '23 23:10 marex

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

jan-kiszka avatar Oct 31 '23 11:10 jan-kiszka

Any follow-ups planned?

jan-kiszka avatar Mar 08 '24 07:03 jan-kiszka

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

chriswiggins avatar May 16 '24 00:05 chriswiggins

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).

fmoessbauer avatar May 16 '24 08:05 fmoessbauer

Now available upstream.

jan-kiszka avatar May 31 '24 16:05 jan-kiszka