From c28a4e03400d71af95801e1e7cb4e50bebaa4075 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 14 Sep 2022 11:18:58 +0900 Subject: [PATCH] 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 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) 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{(?