Proposals
This article is intended for wiki administrators.
A wiki can be edited two ways: in the browser, where a save goes straight to the page, and in a clone, where it arrives as a proposal that somebody merges. This page is about the second.
Cloning
git clone https://wiki.example.com
There is no path and no special port: the wiki answers git at the address you already open in a browser. On a wiki that is not locked, cloning needs no account. On a locked wiki it needs one, and git will ask for it.
The clone carries every page and its history. Proposals are not included: a clone shows the wiki as it is.
Publishing a change
Work on a branch whose name starts with proposal/, and push that branch:
git clone https://wiki.example.com wiki
cd wiki
git switch -c proposal/fix-the-bridge
# edit pages
git commit -am "bridge: fix the opening date"
git push origin proposal/fix-the-bridge
The push needs an account that may edit pages; git will ask for the name and password. The branch then appears at /admin/proposals, with the name of whoever opened it, the pages it changes, and whether it merges cleanly.
Nothing else may be pushed. A push to any branch outside proposal/, including the branch the wiki serves, is refused, so a page goes live only by a browser save or by a merge somebody made deliberately.
Reviewing
A clean merge is not a good change: it means git found no overlap, not that the proposal does what it says. Diff on the proposals page shows what each file changes, in two comparisons:
-
What the editor changed — their own work, from where the proposal parted from the branch.
-
How it differs from the branch — the branch as it is now, against the proposal's version. When the branch has moved since, a page both sides changed appears here as the pair you have to judge.
The second is not the merge's result: a merge keeps both sides, so a line the branch changed shows there as removed even though merging would keep it.
Merging
Merge takes a proposal that merges cleanly; Discard throws one away. Merging writes the pages and rebuilds the indexes, then deletes the branch, because its commits are in the wiki's history.
Conflicts
A proposal that conflicts — a page it changed was also changed in the browser since — cannot be merged until every conflicting page is settled. Resolve shows one page at a time, the two versions fenced by <<<<<<<, ======= and >>>>>>>: before the ======= is the branch as it is now, after it the proposal. Keep what belongs in the page, delete the markers, and save. Progress is kept, so the page can be closed and come back to.
A conflict can be settled in a clone instead, which is better when the proposal changes many pages:
git fetch origin
git rebase origin/HEAD # the branch the wiki serves
# resolve, then
git push --force-with-lease origin proposal/fix-the-bridge
origin/HEAD is whatever branch this wiki serves — main for a wiki created by
a recent release, master for an older one. git branch -r says which.
Force-pushing your own proposal branch is allowed; force-pushing anything else is not.
When the wiki refuses to start
The push rule belongs to the repository, not to the wiki program, so git itself refuses a push. The wiki installs it on every start. If it finds a pre-receive hook it did not write, it stops and says so rather than run without the rule — move that hook aside, or teach it the same rule, and start again.