diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-03-19 13:53:43 -0700 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-03-19 21:10:39 +0000 |
commit | 8367096d02fb288e67586182c6d3e32bb7b72ce1 (patch) | |
tree | a3836466ab395f4bb64bb499bda18f52c8276e87 /git_superproject.py | |
parent | d34af28ac2b5f8c2bc84342d86d98eca916319b3 (diff) | |
download | git-repo-8367096d02fb288e67586182c6d3e32bb7b72ce1.tar.gz |
superproject: Added --depth=1 argument to git fetch command.
Tested the code with the following commands.
$ ./run_tests -v
Without --depth
$ time repo_dev init -u sso://googleplex-android.git.corp.google.com/platform/manifest -b master --repo-rev=main --use-superproject
real 6m48.086s
user 3m27.281s
sys 1m1.386s
With --depth=1
$ time repo_dev init -u sso://googleplex-android.git.corp.google.com/platform/manifest -b master --repo-rev=main --use-superproject
real 2m49.637s
user 2m51.458s
sys 0m39.108s
From dwillemsen@:
"For me it's the difference between 9m28s using the current code and
16s using --depth=1 while fetching the superproject."
Bug: [google internal] b/180451672
Bug: https://crbug.com/gerrit/13707
Change-Id: I1c3e4aef4414c4e9dd259fb6e4619da0421896b0
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/300922
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'git_superproject.py')
-rw-r--r-- | git_superproject.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git_superproject.py b/git_superproject.py index 7f0582cb..89320971 100644 --- a/git_superproject.py +++ b/git_superproject.py | |||
@@ -121,7 +121,7 @@ class Superproject(object): | |||
121 | print('git fetch missing drectory: %s' % self._work_git, | 121 | print('git fetch missing drectory: %s' % self._work_git, |
122 | file=sys.stderr) | 122 | file=sys.stderr) |
123 | return False | 123 | return False |
124 | cmd = ['fetch', url, '--force', '--no-tags', '--filter', 'blob:none'] | 124 | cmd = ['fetch', url, '--depth', '1', '--force', '--no-tags', '--filter', 'blob:none'] |
125 | if self._branch: | 125 | if self._branch: |
126 | cmd += [self._branch + ':' + self._branch] | 126 | cmd += [self._branch + ':' + self._branch] |
127 | p = GitCommand(None, | 127 | p = GitCommand(None, |