summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2025-10-10 14:48:49 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2025-10-10 14:49:23 -0700
commitd0d1246cd414655356e218e25a1c32666227e504 (patch)
tree06a5ac3a2b02c8cea317ea0e75e7e9ac482dcbcf
parent0090311db21b4c0e67a00a381156d7a8a1f6a262 (diff)
sync_default_gems.rb: Minimize the number of refs
fetched from the repository
-rwxr-xr-xtool/sync_default_gems.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index f404b7ff50..b4bd761a72 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -64,6 +64,10 @@ module SyncDefaultGems
CLASSICAL_DEFAULT_BRANCH = "master"
+ # Allow synchronizing commits up to this FETCH_DEPTH. We've historically merged PRs
+ # with about 250 commits to ruby/ruby, so we use this depth for ruby/ruby in general.
+ FETCH_DEPTH = 500
+
class << REPOSITORIES
def [](gem)
repo, branch = super(gem)
@@ -662,7 +666,7 @@ module SyncDefaultGems
`git remote add #{gem} https://github.com/#{repo}.git`
end
end
- system(*%W"git fetch --no-tags #{gem}")
+ system(*%W"git fetch --no-tags --depth=#{FETCH_DEPTH} #{gem} #{default_branch}")
commits = commits_in_ranges(gem, repo, default_branch, ranges)