[前][次][番号順一覧][スレッド一覧]

ruby-changes:65681

From: Nobuyoshi <ko1@a...>
Date: Sun, 28 Mar 2021 23:44:06 +0900 (JST)
Subject: [ruby-changes:65681] 36bad6f14f (master): sync_default_gems.rb: search the last merge more strictly [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=36bad6f14f

From 36bad6f14f30db59f2d51e2acbdd9143230b35c5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 28 Mar 2021 22:58:43 +0900
Subject: 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.
---
 tool/sync_default_gems.rb | 5 +++--
 1 file 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) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L375
   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|
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]