ruby-changes:73546
From: Nobuyoshi <ko1@a...>
Date: Wed, 14 Sep 2022 11:24:34 +0900 (JST)
Subject: [ruby-changes:73546] c28a4e0340 (master): Replace "Fixes"/"Fixed" in commit logs as well as vcs.rb [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=c28a4e0340 From c28a4e03400d71af95801e1e7cb4e50bebaa4075 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 14 Sep 2022 11:18:58 +0900 Subject: Replace "Fixes"/"Fixed" in commit logs as well as vcs.rb [ci skip] Use the same regexp to replace "(#NNNN)" and "GH-NNNN" style references in vcs.rb, too. --- tool/lib/vcs.rb | 2 +- tool/sync_default_gems.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 65ab3d4eec..05d95061c4 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -659,7 +659,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L659 if %r[^ +(https://github\.com/[^/]+/[^/]+/)commit/\h+\n(?=(?: +\n(?i: +Co-authored-by: .*\n)+)?(?:\n|\Z))] =~ s issue = "#{$1}pull/" - s.gsub!(/\b[Ff]ix(?:e[sd])? \K#(?=\d+)/) {issue} + s.gsub!(/\b(?:(?i:fix(?:e[sd])?) +|GH-)\K#(?=\d+\b)|\(\K#(?=\d+\))/) {issue} end s.gsub!(/ +\n/, "\n") diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 5415e0f2b4..1e8c086dcf 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -397,7 +397,7 @@ def message_filter(repo, sha) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L397 log = STDIN.read log.delete!("\r") url = "https://github.com/#{repo}" - print "[#{repo}] ", log.gsub(/\b(?i:fix) +\K#(?=\d+\b)|\(\K#(?=\d+\))|\bGH-(?=\d+\b)/) { + print "[#{repo}] ", log.gsub(/\b(?:(?i:fix(?:e[sd])?) +|GH-)\K#(?=\d+\b)|\(\K#(?=\d+\))/) { "#{url}/pull/" }.gsub(%r{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c| "https://github.com/#{$1 || repo}/commit/#{$2[0,12]}" -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/