summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-05-20 16:03:45 -0700
committerJonathan Nieder <jrn@google.com>2020-05-21 19:47:36 +0000
commitd79a4bc51b6ca5b47bbea861143c72bccc0ad13a (patch)
treef2d8de86fc76c9207af7be2b0c7ff683471df761 /subcmds/sync.py
parent682f0b6426a06ed1e89b130d50c6521b1c67d529 (diff)
downloadgit-repo-d79a4bc51b6ca5b47bbea861143c72bccc0ad13a.tar.gz
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 <delphij@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py8
1 files changed, 6 insertions, 2 deletions
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.
247 p.add_option('-m', '--manifest-name', 247 p.add_option('-m', '--manifest-name',
248 dest='manifest_name', 248 dest='manifest_name',
249 help='temporary manifest to use for this sync', metavar='NAME.xml') 249 help='temporary manifest to use for this sync', metavar='NAME.xml')
250 p.add_option('--no-clone-bundle', 250 p.add_option('--clone-bundle', action='store_true',
251 dest='clone_bundle', default=True, action='store_false', 251 help='enable use of /clone.bundle on HTTP/HTTPS')
252 p.add_option('--no-clone-bundle', dest='clone_bundle', action='store_false',
252 help='disable use of /clone.bundle on HTTP/HTTPS') 253 help='disable use of /clone.bundle on HTTP/HTTPS')
253 p.add_option('-u', '--manifest-server-username', action='store', 254 p.add_option('-u', '--manifest-server-username', action='store',
254 dest='manifest_server_username', 255 dest='manifest_server_username',
@@ -836,6 +837,9 @@ later is required to fix a server side protocol bug.
836 smart_sync_manifest_path = os.path.join( 837 smart_sync_manifest_path = os.path.join(
837 self.manifest.manifestProject.worktree, 'smart_sync_override.xml') 838 self.manifest.manifestProject.worktree, 'smart_sync_override.xml')
838 839
840 if opt.clone_bundle is None:
841 opt.clone_bundle = self.manifest.CloneBundle
842
839 if opt.smart_sync or opt.smart_tag: 843 if opt.smart_sync or opt.smart_tag:
840 manifest_name = self._SmartSyncSetup(opt, smart_sync_manifest_path) 844 manifest_name = self._SmartSyncSetup(opt, smart_sync_manifest_path)
841 else: 845 else: