Bug 13586

Summary: gitshallow: attempt to fetch missing revs in BB_GIT_SHALLOW_REVS
Product: [Build System, Metadata & Runtime] BitBake Reporter: Christopher Larson <kergoth>
Component: bitbakeAssignee: Christopher Larson <kergoth>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Christopher Larson 2019-10-08 19:34:05 UTC
The BB_GIT_SHALLOW_REVS variable lists revisions to use for constructing the shallow repository. For example, if I have a version 4.19.13 kernel recipe, i can specify BB_GIT_SHALLOW_REVS=v4.19 to remove the 4.19 history, leaving only the commits from v4.19 up to the 4.19.13 SRCREV. This lets you control what history is kept, avoiding shipping a massive tarball to a customer, for example, while still distributing the bits which might not be in a public layer.

The issue is, when it determines whether the clonedir needs updating, it only checks for the presence of the SRCREV, not the revs listed in the shallow variable, so if I'm using a trimmed kernel fork that doesn't *have* the v4.19 tag, and I add the missing tag to the repo, it won't pick that up, and will continue to fail to construct the shallow repository until I manually update the clone in DL_DIR or force bitbake to do so.
Comment 1 Christopher Larson 2019-10-18 18:27:46 UTC
Fixed by https://github.com/openembedded/bitbake/compare/master...kergoth:13586, pending email to the list and then merge. I'll submit to the list today after doing another run of the bitbake unit tests (the fetch tests are failing for unrelated reasons at the moment).
Comment 2 Christopher Larson 2019-10-21 17:33:30 UTC
Submitted to the bitbake-devel list pending review.
Comment 3 Christopher Larson 2021-03-16 17:54:30 UTC
This was fixed in 93b65e3c6ca64f644946953980595c44fbbcc748 & f7a973604fbfd1059875ff1fabb3f885df9c5b95