5 # a convenient way to display the gitweb URL of a commit-ish
7 # Copyright © 2010 martin f. krafft <madduck@madduck.net>
8 # Released under the terms of the Artistic Licence 2.0
10 # Source repository: git://git.madduck.net/etc/zsh.git
14 GITWEB_BASE=http://git.madduck.net/v
17 REMOTE=$(git config --get remote.origin.url)
21 madduck:pub/*) part="${REMOTE#madduck:pub/}";;
23 echo >&2 "E: I do not know how to translate $REMOTE into a gitweb URL."
28 HASH=$(git rev-parse HEAD)
29 echo $GITWEB_BASE/$part/commitdiff/$HASH