summaryrefslogtreecommitdiff
path: root/tool/sync_default_gems.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-12-06 14:18:01 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-12-06 14:18:01 +0900
commite563c6068eed526e7eb9bc4d3606501c827da674 (patch)
treef045d55c16792e3a86451c86c1da9bb7854f6d04 /tool/sync_default_gems.rb
parentc2192cb985c10c90ba5e4d64652f79f89afff983 (diff)
sync_default_gems.rb: convert commit hashes to github URLs [ci skip]
Diffstat (limited to 'tool/sync_default_gems.rb')
-rwxr-xr-xtool/sync_default_gems.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 4ed0785e47..9557458007 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -380,6 +380,8 @@ def message_filter(repo, sha)
url = "https://github.com/#{repo}"
print "[#{repo}] ", log.gsub(/fix +#\d+|\(#\d+\)/i) {
$&.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)/) {
"\n\n" "#{url}/commit/#{sha[0,10]}\n"
}