From d79a4bc51b6ca5b47bbea861143c72bccc0ad13a Mon Sep 17 00:00:00 2001 From: Xin Li Date: Wed, 20 May 2020 16:03:45 -0700 Subject: Make partial clone imply no-clone-bundle by default. For large projects, clone bundle is useful because it provided a way to efficiently transfer a large portion of git objects through CDN, without needing to interact with git server. However, with partial clones, the intention is to not download most of the objects, so the use of clone bundles would defeat the space savings normally seen with partial clones, as they are downloaded before the first fetch. A new option, --clone-bundle is added to override this behavior. Add a new repo.clonebundle variable which remembers the choice if explicitly given from command line at repo init. Change-Id: I03638474af303a82af34579e16cd4700690b5f43 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/268452 Tested-by: Xin Li Reviewed-by: Jonathan Nieder --- subcmds/sync.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'subcmds/sync.py') diff --git a/subcmds/sync.py b/subcmds/sync.py index efd39616..a40dd5e0 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -247,8 +247,9 @@ later is required to fix a server side protocol bug. p.add_option('-m', '--manifest-name', dest='manifest_name', help='temporary manifest to use for this sync', metavar='NAME.xml') - p.add_option('--no-clone-bundle', - dest='clone_bundle', default=True, action='store_false', + p.add_option('--clone-bundle', action='store_true', + help='enable use of /clone.bundle on HTTP/HTTPS') + p.add_option('--no-clone-bundle', dest='clone_bundle', action='store_false', help='disable use of /clone.bundle on HTTP/HTTPS') p.add_option('-u', '--manifest-server-username', action='store', dest='manifest_server_username', @@ -836,6 +837,9 @@ later is required to fix a server side protocol bug. smart_sync_manifest_path = os.path.join( self.manifest.manifestProject.worktree, 'smart_sync_override.xml') + if opt.clone_bundle is None: + opt.clone_bundle = self.manifest.CloneBundle + if opt.smart_sync or opt.smart_tag: manifest_name = self._SmartSyncSetup(opt, smart_sync_manifest_path) else: -- cgit v1.2.3-54-g00ecf