diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-03-28 22:58:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-03-28 22:58:43 +0900 |
commit | 36bad6f14f30db59f2d51e2acbdd9143230b35c5 (patch) | |
tree | 93f677c4b355a7323fafb236daf827323694d46e /tool/sync_default_gems.rb | |
parent | 49c1c2dce35e9f818be396dacbaa9a3ff72b5985 (diff) | |
download | ruby-36bad6f14f30db59f2d51e2acbdd9143230b35c5.tar.gz |
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.
Diffstat (limited to 'tool/sync_default_gems.rb')
-rw-r--r-- | tool/sync_default_gems.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 632253874d..540a052d24 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| |