From 071bf889706d13879c323d61fd2e757ff32c8bda Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 26 Jul 2019 16:06:54 +0800 Subject: Improve the commits list for cherry-picking from default gems. * Ignore Merge commit from the commit lists before trying to pick commit. * Show the commits list at first. --- tool/sync_default_gems.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index aa98f60ca1..599d6b3281 100644 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -240,12 +240,15 @@ def sync_default_gems_with_commits(gem, range) IO.popen(%W"git log --format=%H,%s #{range}") do |f| commits = f.read.split("\n").reverse.map{|commit| commit.split(',')} + + # Ignore Merge commit for ruby core repository. + commits.delete_if{|_, subject| subject =~ /^Merge/} + + puts "Try to pick these commits:" + puts commits.map{|commit| commit.join(": ")}.join("\n") + commits.each do |sha, subject| puts "Pick #{sha} from #{$repositories[gem.to_sym]}." - if subject =~ /^Merge/ - puts "Skip #{sha}. Because It was merge commit" - next - end `git cherry-pick #{sha}` unless $?.success? -- cgit v1.2.3