aboutsummaryrefslogtreecommitdiffstats
path: root/abbrevURL
diff options
context:
space:
mode:
Diffstat (limited to 'abbrevURL')
-rwxr-xr-xabbrevURL5
1 files changed, 4 insertions, 1 deletions
diff --git a/abbrevURL b/abbrevURL
index 21a391e..6f938e8 100755
--- a/abbrevURL
+++ b/abbrevURL
@@ -12,9 +12,12 @@ end
str = str:gsub("https?://github.com/(.*)/issues/(%d+)", "gh#%1#%2")
str = str:gsub("https?://github.com/(.*)/pull/(%d+)", "gh#%1#%2")
-str = str:gsub("https?://gitlab.com/(.*)/-/issues/(%d+)", "gl#%1#%2")
+str = str:gsub("https?://github.com/(.*)/commit/(%w+)", function (r, i)
+ return "gh#" .. r .. "@" .. i:sub(1, 12)
+end)
str = str:gsub("https?://gitlab.com/(.*)/issues/(%d+)", "gl#%1#%2")
str = str:gsub("https?://gitlab.com/(.*)/pull/(%d+)", "gl#%1#%2")
+str = str:gsub("https?://gitlab.com/(.*)/-/issues/(%d+)", "gl#%1#%2")
str = str:gsub("https?://gitlab.com/(.*)/-/pull/(%d+)", "gl#%1#%2")
str = str:gsub("https?://gitlab.com/(.*)/-/merge-requests/(%d+)", "gl#%1#%2")
str = str:gsub("https?://sourceforge.net/support/tracker.php%?aid=(%d+)", "sh#%1")