зеркало из https://github.com/github/ruby.git
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:
Родитель
f863bc505c
Коммит
c28a4e0340
|
@ -659,7 +659,7 @@ class VCS
|
||||||
|
|
||||||
if %r[^ +(https://github\.com/[^/]+/[^/]+/)commit/\h+\n(?=(?: +\n(?i: +Co-authored-by: .*\n)+)?(?:\n|\Z))] =~ s
|
if %r[^ +(https://github\.com/[^/]+/[^/]+/)commit/\h+\n(?=(?: +\n(?i: +Co-authored-by: .*\n)+)?(?:\n|\Z))] =~ s
|
||||||
issue = "#{$1}pull/"
|
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
|
end
|
||||||
|
|
||||||
s.gsub!(/ +\n/, "\n")
|
s.gsub!(/ +\n/, "\n")
|
||||||
|
|
|
@ -397,7 +397,7 @@ def message_filter(repo, sha)
|
||||||
log = STDIN.read
|
log = STDIN.read
|
||||||
log.delete!("\r")
|
log.delete!("\r")
|
||||||
url = "https://github.com/#{repo}"
|
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/"
|
"#{url}/pull/"
|
||||||
}.gsub(%r{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c|
|
}.gsub(%r{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c|
|
||||||
"https://github.com/#{$1 || repo}/commit/#{$2[0,12]}"
|
"https://github.com/#{$1 || repo}/commit/#{$2[0,12]}"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче