}
git_url() {
- [[ $# -ne 0 ]] && err "no args supported"
+ [[ $# -gt 1 ]] && err "accepted args: <rev>"
local repo url
local remote=$(git config remote.origin.url)
repo=$(echo "${remote}" | sed -e 's,^git@github.com/,,' -e 's,^https://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$::')
+ url="http://git.savannah.gnu.org/cgit/${repo}.git/commit/?h="
+ ;;
*)
echo "Unknown remote: ${remote}"
exit 1