[bitbake-devel] [master][PATCH 3/3] bb.fetch.git: add support for shallow mirror tarballs

Christopher Larson chris_larson at mentor.com
Sat Apr 30 19:46:11 UTC 2016


On Sat, Apr 30, 2016 at 12:44 PM, Christopher Larson <kergoth at gmail.com>
wrote:

> From: Christopher Larson <chris_larson at mentor.com>
>
> This adds support to the git fetcher for fetching and generating mirror
> tarballs of shallow git repositories, with the specified revisions /
> depths.
>
> This implements support for shallow mirror tarballs, not shallow clones.
> Supporting shallow clones directly would be rather more problematic, as
> we'd
> need to hardcode the depth between branch HEAD and the SRCREV, and that
> depth
> would change as the branch is updated. Sadly, git's remote protocol is
> extremely limited.
>
> When BB_GIT_SHALLOW is enabled, we will always attempt to fetch a shallow
> mirror tarball. If the shallow mirror tarball cannot be fetched, it will
> try
> to fetch the full mirror tarball and use that.
>
> Multiple variables exist to exert control over what revisions and refs are
> kept at what are not.
>
> BB_GIT_SHALLOW: enable/disable shallow support as a whole, boolean
> BB_GIT_SHALLOW_DEPTH: specify commit depth for the included refs. defaults
> to 1 (the top commit alone). This can be set to 0 or the empty string.
> BB_GIT_SHALLOW_DEPTH_<name>: specify commit depth for a specific named
> url/branch
> BB_GIT_SHALLOW_REVS: specific revisions whose history should be removed,
> beyond that specified by refs+depth
> BB_GIT_SHALLOW_TRIM_REFS: by default, unused refs/branches are removed.
> set this to 0 or the empty string to keep all refs around. this is required
> for linux-yocto kernel repositories, otherwise the branch checking done by
> the kernel scripts will fail
> BB_GIT_SHALLOW_EXTRA_REFS: additional refs to keep beyond those referenced
> in SRC_URI, when TRIM_REFS is enabled
> BB_GENERATE_SHALLOW_TARBALLS: explicitly control creation of shallow
> mirror tarballs. this defaults to enabled when BB_GENERATE_MIRROR_TARBALLS
> is enabled
>
> Example usage:
>
>     BB_GIT_SHALLOW ?= "1"
>     BB_GIT_SHALLOW_DEPTH ?= "1"
>
>     # Usage in a recipe with multiple named uris or multiple named branches
>     BB_GIT_SHALLOW_DEPTH_doc = ""
>
>     # Remove the upstream history from our kernel repo, keeping our own
>     BB_GIT_SHALLOW_REVS_pn-linux-mel_mx6 = "v3.14"
>     BB_GIT_SHALLOW_DEPTH_pn-linux-mel_mx6 = ""
>
>     # Keep the branches in linux-yocto repositories
>     BB_GIT_SHALLOW_TRIM_REFS_pn-linux-yocto = "0"
>


I'll re-send a v2 of this. I just noticed this accidentally resurrects the
indirectionsymlink.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160430/cd4a83b4/attachment-0002.html>


More information about the bitbake-devel mailing list