Bug 15207 - fetcher: git clone should allow use --depth to reduce data size
Summary: fetcher: git clone should allow use --depth to reduce data size
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 0.0.0
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2023-09-05 11:47 UTC by Gavin
Modified: 2023-09-08 08:47 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin 2023-09-05 11:47:11 UTC
It's really painful to clone large size repository (such as Linux kernel) under bad network condition. It should allow git clone use --depth parameter to reduce data size. Most of the time, we don't need too long history. I didn't find any parameter can do this in the document. If no such feature, I suggest to add this option.
Comment 1 Ross Burton 2023-09-07 14:44:53 UTC
This isn't quite as simple as you'd imagine.  Shallow clones make mirroring harder, some servers refuse to do shallow clones from arbitrary SHAs, and incremental updates become trickier.

However, what you're looking for is implemented, albeit at a global level instead of per-recipe: https://docs.yoctoproject.org/bitbake/dev/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-BB_GIT_SHALLOW
Comment 2 Gavin 2023-09-08 08:47:52 UTC
(In reply to Ross Burton from comment #1)
> This isn't quite as simple as you'd imagine.  Shallow clones make mirroring
> harder, some servers refuse to do shallow clones from arbitrary SHAs, and
> incremental updates become trickier.
> 
> However, what you're looking for is implemented, albeit at a global level
> instead of per-recipe:
> https://docs.yoctoproject.org/bitbake/dev/bitbake-user-manual/bitbake-user-
> manual-ref-variables.html#term-BB_GIT_SHALLOW

Thank you very much for the document.