Short description
InterWiki links are already convenient and we use them a lot on the GNOME wiki. The best example I can think of is GnomeBug:### that expands into http://bugzilla.gnome.org/show_bug.cgi?id=###. We'd like to have such an easy way to link to commits on our cgit interface.
Problem is that the URLs depend on commit hash AND project name too. For instance http://git.gnome.org/browse/planner/commit/?id=a7c0260 which depends on planner and a7c0260, so that would require something like GnomeGit:planner:a7c0260.
We wouldn't need named values, positional would be good enough.
Solution
Why not use a custom macro?
Put "GnomeGit.py" in wiki/data/plugin/macro/
1 """
2 GnomeGit - make a link to a Gnome project git repository
3
4 @copyright: 2010 Henryk Gerlach
5 @license: public domain
6 """
7 from MoinMoin import wikiutil
8
9 Dependencies = []
10
11
12 def macro_GnomeGit(macro, project, gitid):
13 f= macro.request.formatter
14 return f.url(1, "http://git.gnome.org/browse/%s/commit/?id=%s" % (project,gitid)) \
15 +f.text("GnomeGit:%s:%s" % (project,gitid)) \
16 +f.url(0)
and call with
<<GnomeGit(planner,a7c0260)>>
-- 128.178.14.95
Feedback
Thanks for the suggested solution. One of our sysadmins installed a slighty modified version of your macro with f.text('commit '+gitid[0:6]+' from '+project).
Be aware, that this might cause confusion with long tags like GnomeGit(planner,release-1.2)