aboutsummaryrefslogtreecommitdiffstats
path: root/abbrevURL
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2022-06-05 00:59:11 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-03-28 17:08:04 +0100
commit4925f7b8775961ede82f5c1e5a230f52fcdb7be6 (patch)
tree0acac7590b33897d37c9e913cd5e22891b90efb8 /abbrevURL
parente6af213dd9a7572e724fa928ae7f98917965d999 (diff)
downloadvim-suse-changes-4925f7b8775961ede82f5c1e5a230f52fcdb7be6.tar.gz
feat(osurl,abbrevURL): add abbreviation for GitHub commit URL.
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")