Commit 079cd3cc authored by Wez Furlong's avatar Wez Furlong Committed by Facebook GitHub Bot

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
parent 8dfce3ec
...@@ -203,7 +203,7 @@ class PreinstalledNopFetcher(SystemPackageFetcher): ...@@ -203,7 +203,7 @@ class PreinstalledNopFetcher(SystemPackageFetcher):
class GitFetcher(Fetcher): class GitFetcher(Fetcher):
DEFAULT_DEPTH = 100 DEFAULT_DEPTH = 1
def __init__(self, build_options, manifest, repo_url, rev, depth): def __init__(self, build_options, manifest, repo_url, rev, depth):
# Extract the host/path portions of the URL and generate a flattened # Extract the host/path portions of the URL and generate a flattened
...@@ -262,7 +262,7 @@ class GitFetcher(Fetcher): ...@@ -262,7 +262,7 @@ class GitFetcher(Fetcher):
return ChangeStatus() return ChangeStatus()
print("Updating %s -> %s" % (self.repo_dir, self.rev)) 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", "checkout", self.rev], cwd=self.repo_dir)
run_cmd(["git", "submodule", "update", "--init"], cwd=self.repo_dir) run_cmd(["git", "submodule", "update", "--init"], cwd=self.repo_dir)
......
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