<p>Previously, Screwdriver would clone the entire commit tree of a Git repository. In most cases, this was unnecessary since most builds only require the latest single commit. For repositories containing immense commit trees, this behavior led to unnecessarily long build times.</p>
<p>To address this issue, Screwdriver now defaults to <a href="https://www.perforce.com/blog/git-beyond-basics-using-shallow-clones">shallow cloning</a> Git repositories with a depth of 50. Screwdriver will also enable the <code>--no-single-branch</code> flag by default in order enable access to other branches in the repository. To disable shallow cloning, simply set the <code>GIT_SHALLOW_CLONE</code> environment variable to <code>false</code>.</p><!-- more -->
<h2>Example</h2>
<pre><code>jobs:
main:
environment:
GIT_SHALLOW_CLONE: false
image: node:8
steps:
- hello: echo hello
requires: [~pr, ~commit]
</code></pre>
<p>Here is a comparison of the build speed improvement for a repository containing over ~160k commits.</p>
<p>Before:</p>
<figure data-orig-width="172" data-orig-height="43"><img src="https://66.media.tumblr.com/7c7e54e1dceed54cbe05865cd12b0af7/tumblr_inline_pi3oimjDmo1uvhog4_540.png" alt="image" data-orig-width="172" data-orig-height="43"/></figure><p>After:</p>
<figure data-orig-width="161" data-orig-height="46"><img src="https://66.media.tumblr.com/254c9ad59dea6931ad1bb460f5b103c7/tumblr_inline_pi3oirCjip1uvhog4_540.png" alt="image" data-orig-width="161" data-orig-height="46"/></figure><p>For more information, please consult the <a href="https://docs.screwdriver.cd/user-guide/FAQ#how-do-i-disable-shallow-cloning">Screwdriver V4 FAQ</a>.</p>
<h2>Compatibility List</h2>
<p>In order to use the new build cache feature, you will need these minimum versions:</p>
<ul><li><a href="https://hub.docker.com/r/screwdrivercd/screwdriver">screwdrivercd/screwdriver</a>:v0.5.501</li>
</ul><h2>Contributors</h2>
<p>Thanks to the following people for making this feature possible:</p>
<ul><li><a href="https://github.com/Filbird"><b>Filbird</b></a></li>
</ul><p>Screwdriver is an open-source build automation platform designed for Continuous Delivery. It is built (and used) by Yahoo. Don’t hesitate to reach out if you have questions or would like to contribute: <a href="http://docs.screwdriver.cd/about/support">http://docs.screwdriver.cd/about/support</a></p>