<arg><option>--[no-]pristine-tar</option></arg>
<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--depth=</option><replaceable>depth</replaceable></arg>
<arg choice="plain"><replaceable>remote_uri</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--depth</option>=<replaceable>depth</replaceable>
+ </term>
+ <listitem>
+ <para>Git history depth, for creating shallow git clones.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--verbose</option></term>
<term><option>-v</option></term>
<listitem>
<arg><option>--[no-]pristine-tar</option></arg>
<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--depth=</option><replaceable>depth</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--depth</option>=<replaceable>depth</replaceable>
+ </term>
+ <listitem>
+ <para>Git history depth, for deepening shallow git clones.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--verbose</option></term>
<term><option>-v</option></term>
<listitem>
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
+ branch_group.add_option("--depth", action="store", dest="depth", default=0,
+ help="git history depth (for creating shallow clones)")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
pass
try:
- repo = GitRepository.clone(os.path.curdir, source)
+ repo = GitRepository.clone(os.path.curdir, source, options.depth)
os.chdir(repo.path)
# Reparse the config files of the cloned repository so we pick up the
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
+ branch_group.add_option("--depth", action="store", dest="depth", default=0,
+ help="git history depth (for deepening shallow clones)")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
gbp.log.err(out)
raise GbpError
- repo.fetch()
+ repo.fetch(options.depth)
for branch in branches:
if not fast_forward_branch(branch, repo, options):
retval = 2