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://git.sv.gnu.org/*)
- repo=$(echo "${remote}" | sed -e 's,^git://git.sv.gnu.org/,,' -e 's:[.]git$::')
+ 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 -e 's,^[^/]*//[^/]*/,,' -e 's,[.]git$,,')
url="https://git.enlightenment.org/${repo}.git/commit/?id="
;;
+ *://git.qemu.org/*)
+ repo=$(echo "${remote}" | sed -e 's,^[^/]*//[^/]*/,,' -e 's,[.]git$,,')
+ url="http://git.qemu.org/?p=${repo}.git;a=commit;h="
+ ;;
*)
echo "Unknown remote: ${remote}"
exit 1
}
main() {
- local vcs="git"
+ local vcs="auto"
while [[ $# -gt 0 ]] ; do
case $1 in
-c) vcs="cvs";;
shift
done
+ if [[ ${vcs} == "auto" ]] ; then
+ if [[ -d CVS ]] ; then
+ vcs="cvs"
+ elif svn info >&/dev/null ; then
+ vcs="svn"
+ else
+ vcs="git"
+ fi
+ fi
+
case ${vcs} in
cvs) cvs_url "$@";;
git) git_url "$@";;