<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 30, 2016 at 12:51 PM, Christopher Larson <span dir="ltr">&lt;<a href="mailto:kergoth@gmail.com" target="_blank">kergoth@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">From: Christopher Larson &lt;<a href="mailto:chris_larson@mentor.com">chris_larson@mentor.com</a>&gt;<br>
<br>
This adds support to the git fetcher for fetching and generating mirror<br>
tarballs of shallow git repositories, with the specified revisions / depths.<br>
<br>
This implements support for shallow mirror tarballs, not shallow clones.<br>
Supporting shallow clones directly would be rather more problematic, as we&#39;d<br>
need to hardcode the depth between branch HEAD and the SRCREV, and that depth<br>
would change as the branch is updated. Sadly, git&#39;s remote protocol is<br>
extremely limited.<br>
<br>
When BB_GIT_SHALLOW is enabled, we will always attempt to fetch a shallow<br>
mirror tarball. If the shallow mirror tarball cannot be fetched, it will try<br>
to fetch the full mirror tarball and use that.<br>
<br>
Multiple variables exist to exert control over what revisions and refs are<br>
kept at what are not.<br>
<br>
BB_GIT_SHALLOW: enable/disable shallow support as a whole, boolean<br>
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.<br>
BB_GIT_SHALLOW_DEPTH_&lt;name&gt;: specify commit depth for a specific named url/branch<br>
BB_GIT_SHALLOW_REVS: specific revisions whose history should be removed, beyond that specified by refs+depth<br>
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<br>
BB_GIT_SHALLOW_EXTRA_REFS: additional refs to keep beyond those referenced in SRC_URI, when TRIM_REFS is enabled<br>
BB_GENERATE_SHALLOW_TARBALLS: explicitly control creation of shallow mirror tarballs. this defaults to enabled when BB_GENERATE_MIRROR_TARBALLS is enabled<br>
<br>
Example usage:<br>
<br>
    BB_GIT_SHALLOW ?= &quot;1&quot;<br>
    BB_GIT_SHALLOW_DEPTH ?= &quot;1&quot;<br>
<br>
    # Usage in a recipe with multiple named uris or multiple named branches<br>
    BB_GIT_SHALLOW_DEPTH_doc = &quot;&quot;<br>
<br>
    # Remove the upstream history from our kernel repo, keeping our own<br>
    BB_GIT_SHALLOW_REVS_pn-linux-mel_mx6 = &quot;v3.14&quot;<br>
    BB_GIT_SHALLOW_DEPTH_pn-linux-mel_mx6 = &quot;&quot;<br>
<br>
    # Keep the branches in linux-yocto repositories<br>
    BB_GIT_SHALLOW_TRIM_REFS_pn-linux-yocto = &quot;0&quot;<br>
<br>
Signed-off-by: Christopher Larson &lt;<a href="mailto:chris_larson@mentor.com">chris_larson@mentor.com</a>&gt;</div></div></blockquote><div><br></div><div>v3 forthcoming (sigh) </div></div>-- <br><div class="gmail_signature"><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div></div>
</div></div>