Commit d5c0b56e authored by danakj's avatar danakj Committed by Commit Bot

Use git fetch --no-tags to fetch commits to apply via cherry-pick.

This changes the behaviour when applying a patch to not fetch tags
along with the patch being applied. The fetch to apply a patch only
needs the commits that will be cherry picked, it does not need tags.

Fetching tags creates slow bottlenecks if a repo such as chromium has
10k+ tags. Using --no-tags prevents the server from sending the list
of all tags and the client from processing them.

Bug: 1019824
Change-Id: I756beb8c2b0c7ec3c0fc48b7431d0cf8c0bbbbd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1894393Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarErik Chen <erikchen@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
parent 1917f7a0
......@@ -419,7 +419,7 @@ class GitWrapper(SCMWrapper):
self.Print('Revision to patch is %r @ %r.' % (patch_repo, patch_rev))
self.Print('Current dir is %r' % self.checkout_path)
self._Capture(['reset', '--hard'])
self._Capture(['fetch', patch_repo, patch_rev])
self._Capture(['fetch', '--no-tags', patch_repo, patch_rev])
patch_rev = self._Capture(['rev-parse', 'FETCH_HEAD'])
if not options.rebase_patch_ref:
......@@ -1335,6 +1335,8 @@ class GitWrapper(SCMWrapper):
fetch_cmd.append('--prune')
if options.verbose:
fetch_cmd.append('--verbose')
if not hasattr(options, 'with_tags') or not options.with_tags:
fetch_cmd.append('--no-tags')
elif quiet:
fetch_cmd.append('--quiet')
self._Run(fetch_cmd, options, show_header=options.verbose, retry=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment