summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-07-14 17:53:14 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-07-14 21:53:19 +0900
commitc8e1be6f1fed7f4f54d5ac1f7ae1ebe2c0f60dbe (patch)
treea195af84927a809e54056c072e57e13422230b22 /tool
parent46491af74ca2266aae0157b79a44898a2f4b728d (diff)
Skip merge commit with rubygems and bundler.
Diffstat (limited to 'tool')
-rw-r--r--tool/sync_default_gems.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 7f5e597f24..5c9ee9a856 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -238,12 +238,18 @@ def sync_default_gems_with_commits(gem, range)
end
end
- IO.popen(%W"git log --format=%H #{range}") do |commits|
- commits.read.split.reverse.each do |commit|
- puts "Pick #{commit} from #{$repositories[gem.to_sym]}."
- `git cherry-pick #{commit}`
+ IO.popen(%W"git log --format=%H,%s #{range}") do |f|
+ commits = f.read.split("\n").reverse.map{|commit| commit.split(',')}
+ 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?
- puts "Failed to pick #{commit}."
+ puts "Failed to pick #{sha}"
break
end