All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
5 # A convenient way to display the gitweb URL of a commit-ish, as well as the
6 # base URL and tree. Also for each argument, the tree or blob URL is printed.
8 # Copyright © 2010 martin f. krafft <madduck@madduck.net>
9 # Released under the terms of the Artistic Licence 2.0
11 # Source repository: git://git.madduck.net/etc/zsh.git
14 local remote; remote=$(git config --get remote.origin.url)
16 local part gitweb_base oldstyle
19 madduck:pub/*|ssh://git.madduck.net/madduck/pub/*)
20 gitweb_base=http://git.madduck.net/v
21 part="${remote#madduck:pub/}"
22 part="${part#ssh://git.madduck.net/madduck/pub/}"
23 part="${part%.git}.git"
25 debian:*|*://git.debian.org/git/*|*@git.debian.org/git/*)
26 gitweb_base=http://git.debian.org
27 part="${remote#debian:}"
28 part="${part#*://git.debian.org/git/}"
29 part="${part#*@git.debian.org/git/}"
30 part="${part%.git}.git"
34 echo >&2 "E: I do not know how to translate $REMOTE into a gitweb URL."
40 hash=$(git rev-parse HEAD)
44 echo "$gitweb_base/$part"
45 echo "$gitweb_base/$part/commitdiff/$hash"
46 echo "$gitweb_base/$part/tree/HEAD"
48 [ -f "$i" ] && echo "$gitweb_base/$part/blob/HEAD:/$i"
49 [ -d "$i" ] && echo "$gitweb_base/$part/tree/HEAD:/$i"
53 echo "$gitweb_base/?p=$part"
54 echo "$gitweb_base/?p=$part;a=commitdiff;h=$hash"
55 echo "$gitweb_base/?p=$part;a=tree;h=HEAD"
57 [ -f "$i" ] && echo "$gitweb_base/?p=$part;a=blob;hb=HEAD;f=$i"
58 [ -d "$i" ] && echo "$gitweb_base/?p=$part;a=tree;hb=HEAD;f=$i"