diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-09-14 11:18:58 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-09-14 11:24:06 +0900 |
commit | c28a4e03400d71af95801e1e7cb4e50bebaa4075 (patch) | |
tree | 71e4cbfcd4fd7236a717a2464f6b9e64eec9f541 | |
parent | f863bc505cf1a976aecd0ed3cb21a3a82956953e (diff) |
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.
-rw-r--r-- | tool/lib/vcs.rb | 2 | ||||
-rwxr-xr-x | 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{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c| "https://github.com/#{$1 || repo}/commit/#{$2[0,12]}" |