Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

marex
Copy link

@marex marex commented Oct 28, 2023

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.

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.

Signed-off-by: Marek Vasut <[email protected]>
@jan-kiszka
Copy link
Collaborator

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

@jan-kiszka
Copy link
Collaborator

Any follow-ups planned?

@chriswiggins
Copy link

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

@fmoessbauer
Copy link
Member

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
Copy link
Collaborator

Now available upstream.

@jan-kiszka jan-kiszka closed this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants