Help:Diff: Difference between revisions
Anthonyhcole (talk | contribs) Clearer. |
→Linking to a diff: added info on using Template:Diff |
||
Line 121: | Line 121: | ||
*<code><nowiki>http://en.wikipedia.org/wiki/PAGETITLE?diff=12345678</nowiki></code> |
*<code><nowiki>http://en.wikipedia.org/wiki/PAGETITLE?diff=12345678</nowiki></code> |
||
Using [[Template:Diff]] is another method of linking to a diff within Wikipedia: |
|||
:{{tlx|Diff|''page''|''diff''|''oldid''|''label''}} |
|||
*<tt>''page''</tt> – The title of the page. |
|||
*<tt>''diff''</tt> – The ID or keyword that is used against the base ID. Possible keywords are: |
|||
*:<tt>cur</tt> – compare with the current version of a page. |
|||
*:<tt>prev</tt> – compare with the previous version of a page. |
|||
*:<tt>next</tt> – compare with the next version of a page. |
|||
*:''id'' – This should be ''larger'' than <tt>oldid</tt>. |
|||
*<tt>''oldid''</tt> – The base ID onto which the diff is generated. |
|||
*<tt>''label''</tt> – Text to display as link. No label will give a numbered link. |
|||
==Deleted revisions== |
==Deleted revisions== |
Revision as of 07:37, 6 August 2013
The 3-tier diff and link series |
---|
A diff is a web page displaying the difference between one version and another of a Wikipedia 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. Clicking a "diff" link in a page's history will display the diff of two successive revisions.
Links to diffs are found on various special pages other than page histories, including the User contributions page which every user has, Recent changes, Related changes, and watchlists.
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 Compare selected revisions.
While editing a page, the Show changes button displays the changes you are about to make. The diff is also shown during an edit conflict.
How it looks
This example shows the top of the diff page (some of the links are dummies). The older version is shown on the left, the newer version on the right.
(Edit summaries in diffs are great) m (correction, + MediaWiki User's Guide)Line 8: Line 8: style="vertical-align: top; padding: 0.33em 0.66em; color: #333333; background-color: #F3F3F3; border-color: #E6E6E6; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%"| 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. style="vertical-align: top; padding: 0.33em 0.66em; color: #333333; background-color: #F3F3F3; border-color: #E6E6E6; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%"| 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. − style="vertical-align: top; padding: 0.33em 0.66em; border-color: #FFE49C; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%" | This is only shown when viewing the diff between the current version and the one immediately preceding it. + style="vertical-align: top; padding: 0.33em 0.66em; border-color: #A3D3FF; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%" | 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. style="vertical-align: top; padding: 0.33em 0.66em; color: #333333; background-color: #F3F3F3; border-color: #E6E6E6; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%"|This example shows the top of the diff page, with links the described above. style="vertical-align: top; padding: 0.33em 0.66em; color: #333333; background-color: #F3F3F3; border-color: #E6E6E6; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%"|This example shows the top of the diff page, with links the described above. Line 25: Line 25: style="vertical-align: top; padding: 0.33em 0.66em; color: #333333; background-color: #F3F3F3; border-color: #E6E6E6; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%" | </table> style="vertical-align: top; padding: 0.33em 0.66em; color: #333333; background-color: #F3F3F3; border-color: #E6E6E6; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%" | </table> + style="vertical-align: top; padding: 0.33em 0.66em; border-color: #A3D3FF; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%" | [[MediaWiki User's Guide]] + style="vertical-align: top; padding: 0.33em 0.66em; border-color: #A3D3FF; border-style: solid; border-width: 1px 1px 1px 4px; Template:Border-radius; border-spacing: 4px; font-size: 85%" |
Explanation of colours
Unchanged text is dark grey on light grey (only parts before and after changed text are shown). Paragraphs which have changed are black on white, with an orange border on the old version side and a blue border on the new version side. Inserted and removed text is highlighted with the border color and bolded. Where whole paragraphs have been removed or inserted, no highlighting or bolding is applied and the other side is blank.
Old version | New version |
---|---|
align="center" style="color:#333333;background-color:#F3F3F3;border-color:#E6E6E6;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"|unchanged | align="center" style="color:#333333;background-color:#F3F3F3;border-color:#E6E6E6;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"|unchanged |
align="center" style="border-color:#FFE49C;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"|paragraph changed | align="center" style="border-color:#A3D3FF;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"|paragraph changed |
align="center" style="border-color:#FFE49C;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"|paragraph removed | |
align="center" style="border-color:#A3D3FF;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"|paragraph added | |
align="center" style="border-color:#FFE49C;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"| removed text | align="center" style="border-color:#A3D3FF;border-style:solid;border-width:1px 1px 1px 4px;Template:Border-radius"| added text |
Controls and links
The links "Revision as of date" link to each version. If the newer version is the latest one, the link will be to the usual page and the wording will be "Current revision (date)" instead.
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 MediaWiki:undo-summary (Undid revision $1 by $2 (talk)). 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 rollbackers, 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.
Linking to a diff
If you need to create a link to a specific diff (for use on a talk page or noticeboard, for example), then locate the diff from the page history, go to the diff page, and copy the URL from your browser's address bar. Then either paste this URL (the whole of it, including http://) into the text of the page where you want the link to appear, putting single square brackets [...] around it; or better still, use the template {{Diff}}, which makes the link work across protocols (http://
vs. https://
) and on our mobile site.
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:
http://en.wikipedia.org/w/index.php?title=PAGETITLE&oldid=12345678
then URLs for its diffs may take the forms:
- diff with the current version:
http://en.wikipedia.org/w/index.php?title=PAGETITLE&diff=cur&oldid=123456789
- diff with the previous version:
http://en.wikipedia.org/w/index.php?title=PAGETITLE&diff=prev&oldid=123456789
- diff with version 10000001:
http://en.wikipedia.org/w/index.php?title=PAGETITLE&diff=100000001&oldid=123456789
A shorter alternative to link to the diff with the previous version is:
http://en.wikipedia.org/wiki/PAGETITLE?diff=12345678
Using Template:Diff is another method of linking to a diff within Wikipedia:
{{Diff|page|diff|oldid|label}}
- page – The title of the page.
- diff – The ID or keyword that is used against the base ID. Possible keywords are:
- cur – compare with the current version of a page.
- prev – compare with the previous version of a page.
- next – compare with the next version of a page.
- id – This should be larger than oldid.
- oldid – The base ID onto which the diff is generated.
- label – Text to display as link. No label will give a numbered link.
Deleted revisions
An administrator can see deleted revisions and diffs but those diffs can only be shared with other administrators. In order to allow all users to view the diff, the revisions in question need to be restored temporarily. See Wikipedia:Revision deletion for further details. (The term "deleted revision" refers to a version of an article that for some reason has been made "invisible" to the general public.)
Simplifying diffs
When moving or copying a piece of text within a page or from another page, and also making other edits in the same revision, the diff display can become cluttered and confusing. Instead, a diff can be kept clearer (simpler), by first using a separate edit to move, or split, text paragraphs, then after saving, in the next edit revisions, add or change text within the split paragraphs. If paragraphs are both split and reworded in the same revision, then the new words cannot be highlighted as different from the prior revision.
A diff shows differences per line, so it relies on matching newlines. 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 (<ref>...</ref>
) may be split with internal newlines as well.
Searching diffs to spot a particular change
If you're trying to find the point in a page's history where a particular change was made, and searching the edit summaries does not help, try taking the diff between points roughly 1/3 and 2/3 of the way through the history. From this diff, you can work out in which of the three parts of the history the change occurred. Repeat this process, narrowing the "search space" by a factor of three each time, until the precise edit where the change was made is identified. You can also use the external WikiBlame tool, which automates this searching process.
Format for displaying a diff
In the case of the Classic skin with quickbar, the diff page does not have the quickbar, to provide more space. Therefore the diff page is also useful for viewing the page on full-screen width, without changing the preferences. With the Monobook skin the panels on the left are also on the diff page.
On a diff page sometimes, the whole display might be wider than the screen window, often because some website URLs (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.
See also
- Wikipedia:Complete diff and link guide — describes some other options and uses.
- Wikipedia:Simple diff and link guide — is simpler! With fewer options! For the newbies!
- Template:Wiki diff — for simulating diffs
- Meta:Help:Diff, briefly mentioning diffing separate pages
- Special:ComparePages