[前][次][番号順一覧][スレッド一覧]

ruby-changes:60640

From: Nobuyoshi <ko1@a...>
Date: Fri, 3 Apr 2020 10:50:14 +0900 (JST)
Subject: [ruby-changes:60640] 691a15ebc7 (master): [sync_default_gems.rb] Reset files to be ignored

https://git.ruby-lang.org/ruby.git/commit/?id=691a15ebc7

From 691a15ebc7ebc27d2f0c25321a1fe85022ec8ea2 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 1 Apr 2020 18:40:27 +0900
Subject: [sync_default_gems.rb] Reset files to be ignored

[ci skip]

diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 56f3fc0..1a8f54b 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -348,9 +348,7 @@ def sync_default_gems_with_commits(gem, range) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L348
 
   # Ignore Merge commit and insufficiency commit for ruby core repository.
   commits.delete_if do |sha, subject|
-    files = IO.popen(%W"git diff-tree --no-commit-id --name-only -r #{sha}") do |f|
-      f.readlines
-    end
+    files = IO.popen(%W"git diff-tree --no-commit-id --name-only -r #{sha}", &:readlines)
     subject =~ /^Merge/ || subject =~ /^Auto Merge/ || files.all?{|file| file =~ IGNORE_FILE_PATTERN}
   end
 
@@ -375,12 +373,21 @@ def sync_default_gems_with_commits(gem, range) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L373
     next if skipped
 
     if result.empty?
+      skipped = true
+    elsif result.start_with?("CONFLICT")
+      result = IO.popen(%W"git status --porcelain", &:readlines).each(&:chomp!)
+      ignore = result.map {|line| /^DU / =~ line and IGNORE_FILE_PATTERN =~ (name = $') and name}
+      ignore.compact!
+      system(*%W"git reset", *ignore) unless ignore.empty?
+      skipped = !system({"GIT_EDITOR"=>"true"}, *%W"git cherry-pick --no-edit --continue")
+    end
+
+    if skipped
       failed_commits << sha
       `git reset` && `git checkout .` && `git clean -fd`
-      skipped = true
       puts "Failed to pick #{sha}"
+      next
     end
-    next if skipped
 
     puts "Update commit message: #{sha}"
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]