1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.
This commit is contained in:
Nobuyoshi Nakada 2022-09-14 11:18:58 +09:00
parent f863bc505c
commit c28a4e0340
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 2 additions and 2 deletions

View file

@ -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")

View file

@ -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]}"