1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.
This commit is contained in:
Hiroshi SHIBATA 2019-07-26 16:06:54 +08:00
parent 348c9687bf
commit 071bf88970
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -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?