]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/distributed_wikis.mdwn
add discussion on this tip
[ikiwiki.git] / doc / tips / distributed_wikis.mdwn
1 [[rcs/git]] and other distributed version control systems are all about
2 making it easy to create and maintain copies and branches of a project. And
3 this can be used for all sorts of interesting stuff. Since ikiwiki can use
4 git, let's explore some possibilities for distributed wikis.
5
6 ## a wiki mirror
7
8 The simplest possibility is setting up a mirror. If a wiki exposes its git
9 repository and has the [[plugins/pinger]] plugin enabled, then anyone can
10 set up a mirror that will automatically be kept up-to-date with the origin
11 wiki. Just clone the git repo, configure ikiwiki to use it, enable the
12 [[plugins/pingee]] plugin in your configuration, and edit the origin wiki,
13 adding a ping directive for your mirror:
14
15         \[[!ping from="http://thewiki.com/"
16         to="http://mymirror.com/ikiwiki.cgi?do=ping"]]
17
18 The "from" parameter needs to be the url to the origin wiki. The "to" parameter
19 is the url to ping on your mirror.
20
21 Now whenever the main wiki is edited, it will ping your mirror, which will
22 pull the changes from "origin" using git, and update itself. It could, in
23 turn ping another mirror, etc.
24
25 And if someone edits a page on your mirror, it will "git push origin",
26 committing the changes back to the origin git repository, and updating the
27 origin mirror. Assuming you can push to that git repository. If you can't,
28 and you want a mirror, and not a branch, you should disable web edits on
29 your mirror. (You could also point the cgiurl for your mirror at the origin
30 wiki.)
31
32 ## branching a wiki
33
34 It follows that setting up a branch of a wiki is just like a mirror, except
35 we don't want it to push changes back to the origin. The easy way to
36 accomplish this is to clone the origin git repository using a readonly
37 protocol (ie, "git://"). Then you can't push to it.
38
39 If a page on your branch is modified and other modifications are made to
40 the same page in the origin, a conflict might occur when that change is
41 pulled in. How well will this be dealt with and how to resolve it? I think
42 that the conflict markers will just appear on the page as it's rendered in
43 the wiki, and if you could even resolve the conflict using the web
44 interface. Not 100% sure as I've not gotten into this situation yet.
45
46 --[[Joey]]