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

sync_default_gems.rb: convert commit hashes to github URLs [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2021-12-06 14:18:01 +09:00
parent c2192cb985
commit e563c6068e
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -380,6 +380,8 @@ def message_filter(repo, sha)
url = "https://github.com/#{repo}" url = "https://github.com/#{repo}"
print "[#{repo}] ", log.gsub(/fix +#\d+|\(#\d+\)/i) { print "[#{repo}] ", log.gsub(/fix +#\d+|\(#\d+\)/i) {
$&.sub(/#/) {"#{url}/pull/"} $&.sub(/#/) {"#{url}/pull/"}
}.gsub(%r{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c|
"https://github.com/#{$1 || repo}/commit/#{$2[0,12]}"
}.sub(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) { }.sub(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) {
"\n\n" "#{url}/commit/#{sha[0,10]}\n" "\n\n" "#{url}/commit/#{sha[0,10]}\n"
} }