summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-30 15:04:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-31 10:30:35 +0900
commitdc911a47cee378d1e495c61ec3e6dc24995bdf8e (patch)
tree154a404109ce14fedf135f1adb41e09bd0ac36eb /tool
parent0aa404b9573d028d87072f40ecb9b86dc161b7ef (diff)
sync_default_gems.rb: Move ignored_paths to ignore_file_pattern_for
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8329
Diffstat (limited to 'tool')
-rwxr-xr-xtool/sync_default_gems.rb30
1 files changed, 9 insertions, 21 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 78d9f1b5a2..a54bd15e1f 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -447,10 +447,19 @@ module SyncDefaultGems
# Gem-specific patterns
case gem
+ when "rubygems"
+ # We don't copy any vcr_cassettes to this repository. Because the directory does not
+ # exist, rename detection doesn't work. So it starts with the original path `bundler/`.
+ %r[\A(?:
+ bundler/spec/support/artifice/vcr_cassettes
+ )\z]mx
when "yarp"
+ # Rename detection never works between ruby/ruby/doc and ruby/yarp/docs
+ # since ruby/ruby/doc is not something owned by YARP.
%r[\A(?:
Makefile\.in
|configure\.ac
+ |docs/.*
|fuzz/.*
|rust/.*
|tasks/.*
@@ -527,27 +536,6 @@ module SyncDefaultGems
#++
def resolve_conflicts(gem, sha, edit)
- # Forcibly remove any files that we don't want to copy to this repository.
- # We also ignore them as new `toplevels` even when they don't conflict.
- ignored_paths = []
- case gem
- when "rubygems"
- # We don't copy any vcr_cassettes to this repository. Because the directory does not
- # exist, rename detection doesn't work. So it starts with the original path `bundler/`.
- ignored_paths += %w[bundler/spec/support/artifice/vcr_cassettes]
- when "yarp"
- # Rename detection never works between ruby/ruby/doc and ruby/yarp/docs
- # since ruby/ruby/doc is not something owned by YARP.
- ignored_paths += %w[docs/]
- end
- ignored_paths.each do |path|
- if File.exist?(path)
- puts "Removing: #{path}"
- system("git", "reset", path)
- rm_rf(path)
- end
- end
-
# git has inexact rename detection, so they follow directory renames even for new files.
# However, new files are considered a `CONFLICT (file location)`, so you need to git-add them here.
# We hope that they are not other kinds of conflicts, assuming we don't modify them in this repository.