Skip to content

Commit d0d1246

Browse files
committed
sync_default_gems.rb: Minimize the number of refs
fetched from the repository
1 parent 0090311 commit d0d1246

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tool/sync_default_gems.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ module SyncDefaultGems
6464

6565
CLASSICAL_DEFAULT_BRANCH = "master"
6666

67+
# Allow synchronizing commits up to this FETCH_DEPTH. We've historically merged PRs
68+
# with about 250 commits to ruby/ruby, so we use this depth for ruby/ruby in general.
69+
FETCH_DEPTH = 500
70+
6771
class << REPOSITORIES
6872
def [](gem)
6973
repo, branch = super(gem)
@@ -662,7 +666,7 @@ def sync_default_gems_with_commits(gem, ranges, edit: nil)
662666
`git remote add #{gem} https://github.com/#{repo}.git`
663667
end
664668
end
665-
system(*%W"git fetch --no-tags #{gem}")
669+
system(*%W"git fetch --no-tags --depth=#{FETCH_DEPTH} #{gem} #{default_branch}")
666670

667671
commits = commits_in_ranges(gem, repo, default_branch, ranges)
668672

0 commit comments

Comments
 (0)