feat(wiki): revision diff — compare any two wiki page versions #667
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add side-by-side diff comparison between any two revisions of a wiki page, with a "revert to this version" option. Currently the revision page only shows commit history without visual diffs.
Current State
WikiRevision()inrouters/web/repo/wiki.goshows commit history for a page viaCommitsByFileAndRange()templates/repo/wiki/revision.tmplrenders the commit list with author, date, and messageProposed Changes
New Route
UI Changes to
revision.tmplDiff Rendering
templates/repo/diff/— the same code that renders PR and commit diffsgit diff <sha1> <sha2> -- <filename>Revert
wiki_service.EditWikiPage()with the old contentFiles to Modify
routers/web/repo/wiki.goWikiDiff()handler, revert handlertemplates/repo/wiki/revision.tmplservices/wiki/wiki.goRevertWikiPage()helperWikipedia Parity
Wikipedia's diff view is heavily used by editors to review changes, revert vandalism, and understand edit history. This is essential for collaborative wiki editing.