]> git.wh0rd.org - home.git/commitdiff
vcs-url: add gitlab.com support
authorMike Frysinger <vapier@gentoo.org>
Sat, 17 Feb 2018 02:09:05 +0000 (21:09 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 17 Feb 2018 02:09:05 +0000 (21:09 -0500)
.bin/vcs-url

index 3c1aa8ce04b35d88b116b053d0c63ce706828c94..bba45e2839a98bb15c509be20bfbcc9eccffdc70 100755 (executable)
@@ -88,6 +88,11 @@ 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="