Bug 15207

Summary: fetcher: git clone should allow use --depth to reduce data size
Product: [Build System, Metadata & Runtime] BitBake Reporter: Gavin <attinagaoxu>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Undecided CC: poky.bs.watcher, poky.watcher, ross.burton
Version: unspecified   
Target Milestone: 0.0.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

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.