From 061ce2fe6e13bc59b151c8ba55cef9e64aa4bdd7 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 4 Nov 2020 23:47:55 -0800 Subject: [PATCH] getdeps: don't depend on git fetch depth any longer Summary: This commit takes advantage of git 2.5.0 being able to fetch a requested revision rather than relying on the desired revision being within the depth limited fetch. This relies on having git 2.5.0 on the server which is true for all of the projects we have manifests for; this shows zero matches: ``` $ rg repo_url opensource/fbcode_builder/manifests | grep -v github ``` We've had a couple of situations recently where folks have run into issues with the commit rate in folly being higher than then fetch depth, so this should address that. Refs: https://github.com/facebook/watchman/issues/866 Reviewed By: fanzeyi Differential Revision: D24747992 fbshipit-source-id: e9b67c61dddc9f55e05d8984e8d210e7d2faabcb --- build/fbcode_builder/getdeps/fetcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/fbcode_builder/getdeps/fetcher.py b/build/fbcode_builder/getdeps/fetcher.py index ef552d860..d2fb9f7da 100644 --- a/build/fbcode_builder/getdeps/fetcher.py +++ b/build/fbcode_builder/getdeps/fetcher.py @@ -203,7 +203,7 @@ class PreinstalledNopFetcher(SystemPackageFetcher): class GitFetcher(Fetcher): - DEFAULT_DEPTH = 100 + DEFAULT_DEPTH = 1 def __init__(self, build_options, manifest, repo_url, rev, depth): # Extract the host/path portions of the URL and generate a flattened @@ -262,7 +262,7 @@ class GitFetcher(Fetcher): return ChangeStatus() print("Updating %s -> %s" % (self.repo_dir, self.rev)) - run_cmd(["git", "fetch", "origin"], cwd=self.repo_dir) + run_cmd(["git", "fetch", "origin", self.rev], cwd=self.repo_dir) run_cmd(["git", "checkout", self.rev], cwd=self.repo_dir) run_cmd(["git", "submodule", "update", "--init"], cwd=self.repo_dir)