A diff shows the difference between two versions of a page. A particular version of a page is called a "revision"; each revision has a unique date and time of creation which can be seen in the page history.
Links to diffs are used on various special pages, including the History tab of pages, the User contributions page which every user has, , , and .
Using the history of a page, it is possible to generate a diff between any two versions – select the left radio button for the older version, the right radio button for the newer version, and click .
While editing a page, the button displays the changes you are about to make. The diff is also shown during an edit conflict.
contribs) (Edit summaries in diffs are great) Angela (contribs) m (correction, MediaWiki User's Guide)Line 8: Line 8: For sysops and those with the rollback flag, a [[en:Wikipedia:revert|rollback]] button is shown allowing them to revert from the new version to the old one. For sysops and those with the rollback flag, a [[en:Wikipedia:revert|rollback]] button is shown allowing them to revert from the new version to the old one. − This is only shown when viewing the diff between the current version and the one immediately preceding it. This is only shown when viewing the diff between the recent version of a page and the last version by an author other than the one of the most current version. This example shows the top of the diff page, with links the described above. This example shows the top of the diff page, with links the described above. Line 25: Line 25: </table> </table> [[MediaWiki User's Guide]]
| Colour key ! align="center" width="200" | Old version ! align="center" width="200" | New version |
| unchanged | unchanged | |
| paragraph changed | paragraph changed | |
| paragraph removed | ||
| paragraph added | ||
| removed text | added text |
The "(edit)" link will take you to the page for editing that version. You may be warned that you are editing an out-of-date revision; if you ignore this and continue, you will revert all the edits made since after that revision.
The "(undo)" link on the newer revision's side will revert that specific edit. When you click the link you can check the diff page of the edit you are going to make, and the edit summary will be automatically filled in with the phrase of (). This summary can be edited before you submit your edit. When you are undoing several edits at once, the auto-summary may not work. Though the link exists on all diff pages, it does not function when the revisions conflict. Often versions older than the current one cannot be undone in this way. If it does not work, you will be told that the edit could not be undone and end up in the regular editing page of the current version.
Below that are links to the user page and talk page of the each user who edited the older or the newer versions. Links to the users' contribution lists are also shown. For administrators and , a "rollback" button also appears where applicable, allowing them to revert all of the edits made by that user.
Then the edit summaries are shown in a parenthesis. If the user has used links in their edit summary, these act as links on the diff page as well. If the editor marked the edit as an minor edit, m appears before the summary.
The "Previous edit" and "Next edit" links lead to earlier or later diffs. When you are viewing the diff between two non-consecutive versions of a page, you will also see the message "(x intermediate revisions not shown.)".
After the table of differences, the latest of the two compared versions is shown fully, unless you have specified in your preferences that this is not to be done.
The URL for a diff is based on the oldid value of the old revision. If a revision has oldid value 12345678, its URL is:
then URLs for its diffs may take the forms:
A shorter alternative to link to the diff with the previous version is:
A diff shows differences per line, so it relies on matching . Some editors find that having additional line breaks to break up the text improves the diff function. Otherwise, those large, massive globs of text are difficult to compare. Keep sentences limited in length, such as with 4 prepositions, and seek shorter paragraphs. Long reftag footnotes () may be split with internal newlines as well.
On a diff page sometimes, the whole display might be wider than the screen window, often because some website (especially long ones) are not hidden and do not wrap in a diff column. In such cases, you must then use the horizontal scrollbar of the browser to see the whole width of the display. There is no option to wrap the long lines in the diff display.