Help:Diff
A diff shows the differences between two versions of a page. There are several ways of generating a diff:
- From the page history for any page you can select two versions and press the "Compare selected versions" button to get the diff between those versions
- Following the diff links on recent changes will give a diff between the current version of the page and the previous revision
- While you are editing a page, you can press the "Show changes" button to see a diff between the current version of the page and your edited version
Understanding the diff
The diff is shown in two columns with the old version on the left and the new version on the right.
The head of each column shows information about the revisions being compared. In most cases, this includes the revision number, time and date with links to view or edit that revision, the user name, IP address or host name of the person who made the change with links to their user page, talk page and list of contributions, and the edit summary. If links have been used in the edit summary, these will appear as links on the diff page as well.
An undo link appears to the right of the header for the right hand column unless you are showing the changes in an edit you are making. If you click on this link, the edit page will appear. The text in the text box will be the current text for the page but without the changes between the two edits shown in the diff. This gives a quick way of removing several consecutive edits. If the wiki software is unable to undo these edits, a warning will be displayed and the text box will contain the current page text.
After the column header, both columns show the raw wikitext for the relevant version, i.e. what you see in the edit box. Paragraphs shown in black text on a grey background are identical in both versions. Unchanged paragraphs are only shown if they are immediately before or after changed paragraphs in order to provide context for the changes, in other words, to make it easier for you to locate the changes within the page.
Changed paragraphs are shown on a yellow background in the old version of the text and on a green background for the new version. If there is text in the left column but not in the right column, this indicates that a paragraph has been removed. Similarly, text in the right column with none in the left indicates that a paragraph has been added.
If there is text in both columns, the paragraph has been changed. To make it easy for you to see the changes, text which has been removed is highlighted in red in the left column while text that has been added is highlighted in red in the right column. If you can't see any red text in either column, it usually means that the only changes are to add or remove white space. An exception is extremely long paragraphs (more than 10,000 characters) - no red text is shown as finding the detailed differences for such paragraphs is too resource intensive.
Because of the way the diff is calculated, results can sometimes be a little unexpected. Imagine you have a page with four paragraphs - A B C and D. You edit it to put a new paragraph D between A and B. If you now display the diff, you will see that paragraph D has been inserted. However, if you make some changes to paragraph B making it into B' at the same time as adding paragraph D, the diff will show that the old paragraph B has changed to the new paragraph D and that paragraph B' is completely new.
Preferences
If you are logged in, you can set your preferences to decide whether or not the more recent version of the page is shown below the diff. If you wish, you can override this setting by adding diffonly=1 (to suppress display of the page) or diffonly=0 (to enable display of the page) to the url.