X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fvcs-url;h=94ff2a03d7245cadb1042d7df40c87b2c099e738;hb=53756ed8612888ef97a5c39a83e9ceaaed56ac91;hp=655717defadef405d85f749c0b2aaed25d077204;hpb=afcb1683faace885e780d536e50eab1733e0a6e1;p=home.git diff --git a/.bin/vcs-url b/.bin/vcs-url index 655717d..94ff2a0 100755 --- a/.bin/vcs-url +++ b/.bin/vcs-url @@ -88,13 +88,22 @@ git_url() { repo=$(echo "${remote}" | sed -e 's,^git@github.com[:/],,' -e 's,^https://github.com/,,' -e 's,^git://github.com/,,' -e 's:[.]git$::') url="https://github.com/${repo}/commit/" ;; + git@gitlab.com[:/]*|\ + *://gitlab.com/*) + repo=$(echo "${remote}" | sed -e 's,^git@gitlab.com[:/],,' -e 's,^https://gitlab.com/,,' -e 's,^git://gitlab.com/,,' -e 's:[.]git$::') + url="https://gitlab.com/${repo}/commit/" + ;; git://git.sv.gnu.org/*|git://git.savannah.gnu.org/*) repo=$(echo "${remote}" | sed -r -e 's,^git://git.(sv|savannah).gnu.org/,,' -e 's:[.]git$::') url="http://git.savannah.gnu.org/cgit/${repo}.git/commit/?h=" ;; - git://git.code.sf.net/p/*) - repo=$(echo "${remote}" | sed -r -e 's,git://git.code.sf.net/p/([^/]*)/.*,\1,') - url="http://sourceforge.net/p/${repo}/code/ci/" + git://git.sv.nongnu.org/*|git://git.savannah.nongnu.org/*) + repo=$(echo "${remote}" | sed -r -e 's,^git://git.(sv|savannah).nongnu.org/,,' -e 's:[.]git$::') + url="http://git.savannah.nongnu.org/cgit/${repo}.git/commit/?h=" + ;; + git://git.code.sf.net/p/*|ssh://*@git.code.sf.net/p/*) + repo=$(echo "${remote}" | sed -r -e 's,(git://|ssh://([^@]*@)?)git.code.sf.net/p/([^/]*)/.*,\3,') + url="https://sourceforge.net/p/${repo}/code/ci/" ;; *://sourceware.org/*) repo=$(echo "${remote}" | sed -e 's,.*/,,' -e 's,[.]git$,,') @@ -109,7 +118,11 @@ git_url() { ;; *://git.qemu.org/*) repo=$(echo "${remote}" | sed -e 's,^[^/]*//[^/]*/,,' -e 's,[.]git$,,') - url="http://git.qemu.org/?p=${repo}.git;a=commit;h=" + url="https://git.qemu.org/?p=${repo}.git;a=commit;h=" + ;; + *://git.kernel.org/*) + repo=$(echo "${remote}" | sed -e 's,^[^/]*//[^/]*/,,' -e 's,[.]git$,,') + url="https://git.kernel.org/${repo}.git/commit/?id=" ;; *) echo "Unknown remote: ${remote}" @@ -125,7 +138,7 @@ svn_url() { svn info | \ awk '{ if ($1 == "URL:") { - URL = "http://sources.gentoo.org/" gensub(/.*svnroot\/([^/]*).*/,"\\1",""); + URL = "http://sources.gentoo.org/" gensub(/.*svnroot\/([^/]*).*/, "\\1", 1); } else if ($1 == "Revision:") { rev = $2 URL = URL "?rev=" (rev + 1) "&view=rev"