Skip to content

Commit

Permalink
getdeps: don't depend on git fetch depth any longer
Browse files Browse the repository at this point in the history
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: facebook/watchman#866

Reviewed By: fanzeyi

Differential Revision: D24747992

fbshipit-source-id: e9b67c61dddc9f55e05d8984e8d210e7d2faabcb
  • Loading branch information
wez authored and facebook-github-bot committed Nov 5, 2020
1 parent f79e133 commit 4e062ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/fbcode_builder/getdeps/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def __init__(self):


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
Expand Down Expand Up @@ -262,7 +262,7 @@ def _update(self):
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)

Expand Down

0 comments on commit 4e062ac

Please sign in to comment.