summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-03-28 22:58:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-03-28 22:58:43 +0900
commit36bad6f14f30db59f2d51e2acbdd9143230b35c5 (patch)
tree93f677c4b355a7323fafb236daf827323694d46e
parent49c1c2dce35e9f818be396dacbaa9a3ff72b5985 (diff)
sync_default_gems.rb: search the last merge more strictly [ci skip]
As tag-only match, `[#{repo}]`, may find unexpected commit, e.g., 5bfca88f760727240902a70d1df0cc516ff31a70 for io-console, match by more exact URL pattern.
-rw-r--r--tool/sync_default_gems.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 6322538..540a052 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -375,8 +375,9 @@ def sync_default_gems_with_commits(gem, ranges, edit: nil)
system(*%W"git fetch --no-tags #{gem}")
if ranges == true
- log = IO.popen(%W"git log --fixed-strings --grep=[#{repo}] -n1 --format=%B", &:read)
- ranges = ["#{log[%r[https://github\.com/#{Regexp.quote(repo)}/commit/(\h+)\n\s*(?i:co-authored-by:.*)*\s*\Z], 1]}..#{gem}/master"]
+ pattern = "https://github\.com/#{Regexp.quote(repo)}/commit/([0-9a-f]+)$"
+ log = IO.popen(%W"git log -E --grep=#{pattern} -n1 --format=%B", &:read)
+ ranges = ["#{log[%r[#{pattern}\n\s*(?i:co-authored-by:.*)*\s*\Z], 1]}..#{gem}/master"]
end
commits = ranges.flat_map do |range|