Changes

Jump to navigation Jump to search
20,111 bytes added ,  5 years ago
m
=
{{pp-move-indef}}
{{pp-semi|small=yes}}
{{Hatnote|This page documents the full usage of diffs. For a simpler guide to the basics, see [[Wikipedia:Simple diff and link guide]].}}
{{Wikipedia how-to|WP:DIFF|H:DIFF}}
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 [[Help:page history|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 [[Help:User contributions|User contributions]] page which every user has, [[WP:Recent changes|Recent changes]], [[WP:Related changes|Related changes]], and [[WP:Watchlist|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 {{Button|text=Compare selected revisions}}.

While editing a page, the {{Button|text=Show changes}} button displays the changes you are about to make. The diff is also shown during an [[Help:edit conflict|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.
<blockquote style="border:1px solid black; padding: 1em;">
{| border="0" style="border-spacing: 4px; table-layout: fixed; width: 98%"
|- style="height:1px" <!-- dummy row for column widths -->
| style="width:2%" |
| style="width:48%" |
| style="width:2%" |
| style="width:48%" |
|- align="center" valign="top"
| colspan="2" | <div><strong>[[Help:Page history|Revision as of 22:32, 3 August 2003]] ([[Wikipedia:How to edit a page|edit]])</strong></div>
<div>[[User:Tim Starling|Tim Starling]] ([[User_talk:Tim Starling|talk]] | [[Help:User contributions|contribs]])</div>
<div><span class="comment">([[Help:Edit summary|Edit summaries]] in diffs are great)</span></div>
<div>[[Help:Page history|← Previous edit]]</div>
| colspan="2" |<div><strong>[[Help:Page history|Revision as of 00:10, 18 August 2003]] ([[Wikipedia:How to edit a page|edit]]) ([[Help:Reverting|undo]]) ([[Wikipedia:Notifications/Thanks|thank]])</strong></div>
<div>[[User:Angela|Angela]] ([[User_talk:Angela|talk]] | [[Help:User contributions|contribs]])&nbsp;&nbsp;&nbsp;&nbsp;'''['''[[Wikipedia:Rollback|rollback]]''']'''</div>
<div><abbr class="minoredit" title="This is a minor edit">m</abbr> <span class="comment">(correction, + [[MediaWiki User's Guide]])</span></div>
<div>&nbsp;</div>
|-
| colspan="2" | '''Line 8:'''
| colspan="2" | '''Line 8:'''
|-
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | &#160;
|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; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%"| For sysops and those with the rollback flag, a <nowiki>[[en:Wikipedia:revert|rollback]]</nowiki> button is shown allowing them to revert from the new version to the old one.
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | &#160;
|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; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%"| For sysops and those with the rollback flag, a <nowiki>[[en:Wikipedia:revert|rollback]]</nowiki> button is shown allowing them to revert from the new version to the old one.
|-
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | −
|style="vertical-align: top; padding: 0.33em 0.66em; border-color: #FFE49C; border-style: solid; border-width: 1px 1px 1px 4px; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%" | This is only shown when viewing the diff between the <span style="background: #FEEEC8; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">current</span> version and the one <span style="background: #FEEEC8; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">immediately preceding it</span>.
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | +
|style="vertical-align: top; padding: 0.33em 0.66em; border-color: #A3D3FF; border-style: solid; border-width: 1px 1px 1px 4px; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%" | This is only shown when viewing the diff between the <span style="background: #D8ECFF; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">recent</span> version<span style="background: #D8ECFF; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">&nbsp;of a page</span> and<span style="background: #D8ECFF; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">&nbsp;the last version by an author other than</span> the one <span style="background: #D8ECFF; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">of the most current version</span>.
|-
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | &#160;
|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; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%"|This example shows the top of the diff page, with the links described above.
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | &#160;
|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; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%"|This example shows the top of the diff page, with the links described above.
|-
| colspan="2" | '''Line 25:'''
| colspan="2" | '''Line 25:'''
|-
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | &#160;
|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; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%" | <nowiki></table></nowiki>
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | &#160;
|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; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%" | <nowiki></table></nowiki>
|-
|colspan="2" |
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | +
|style="vertical-align: top; padding: 0.33em 0.66em; border-color: #A3D3FF; border-style: solid; border-width: 1px 1px 1px 4px; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%" | <nowiki>[[MediaWiki User's Guide]]</nowiki>
|-
|colspan="2" |
|style="padding: 0.33em 0.66em; border-spacing: 4px; font-size: 1.25em; font-weight: bold; text-align: right" | +
|style="vertical-align: top; padding: 0.33em 0.66em; border-color: #A3D3FF; border-style: solid; border-width: 1px 1px 1px 4px; {{border-radius|0.33em}}; border-spacing: 4px; font-size: 85%" |
|}
</blockquote>

=== 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.

{| class="wikitable" style="border-collapse:separate;background-color:white"
|+Colour key
! align="center" width="200"|Old version
! align="center" width="200"|New version
|-
|align="center" style="color:#333333;background-color:#F3F3F3;border-color:#E6E6E6;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"|unchanged
|align="center" style="color:#333333;background-color:#F3F3F3;border-color:#E6E6E6;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"|unchanged
|-
|align="center" style="border-color:#FFE49C;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"|paragraph changed
|align="center" style="border-color:#A3D3FF;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"|paragraph changed
|-
|align="center" style="border-color:#FFE49C;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"|paragraph removed
|align="center" style="border:none"|&nbsp;
|-
|align="center" style="border:none"|&nbsp;
|align="center" style="border-color:#A3D3FF;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"|paragraph added
|-
|align="center" style="border-color:#FFE49C;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"| <span style="background: #FEEEC8; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">removed text</span>
|align="center" style="border-color:#A3D3FF;border-style:solid;border-width:1px 1px 1px 4px;{{border-radius|0.33em}}"| <span style="background: #D8ECFF; padding: 0.25em 0; {{border-radius|0.33em}}; font-weight: bold">added text</span>
|}

=== 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 [[Help:Reverting|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 [[Help:Edit summary|edit summary]] will be automatically filled in with the phrase of [[MediaWiki:undo-summary]] ({{MediaWiki:undo-summary}}). 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.

The "(thank)" link is only displayed when both the viewer and editor are registered users. It can be used to [[Wikipedia:Notifications/Thanks|thank]] the editor.

Below that are links to the user page and talk page of each user who edited the older or the newer versions. Links to the users' contribution lists are also shown. For administrators and [[WP:Rollback|rollbackers]], a "[rollback]" button also appears where applicable, allowing them to revert all of the edits made by that user.

Then the [[Help:Edit summary|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 a [[Help:Minor edit|minor edit]], <span class="minor">m</span> 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), it is best to use the [[Special:Diff/''<code>oldid</code>''<nowiki>]]</nowiki> method or {{Tl|Diff}}, which make links work across protocols (<code>http://</code> vs. <code>https://</code>) and on our mobile site. Alternatively, locate the diff from the [[Help:Page history|page history]], go to the diff page, and copy the [[URL]] from your browser's address bar. You can either paste this URL (the whole of it, including <nowiki>http://</nowiki>) into the text of the page where you want the link to appear, putting single square brackets [...] around it.

=== External links ===
The URL for a diff is based on the <code>oldid</code> value of the old revision. If a revision has oldid value 12345678, its URL is:
*<code><nowiki>http://en.wikipedia.org/w/index.php?title=PAGETITLE&oldid=12345678</nowiki></code>

You can strip the <code>title=PAGETITLE&</code> part from the URL and make it look like this:
*<code><nowiki>http://en.wikipedia.org/w/index.php?oldid=12345678</nowiki></code>

Then URLs for its diffs may take the forms:

*Diff with the current version:<br/><code><nowiki>http://en.wikipedia.org/w/index.php?diff=cur&oldid=123456789</nowiki></code>
*Diff with the previous version:<br/><code><nowiki>http://en.wikipedia.org/w/index.php?diff=prev&oldid=123456789</nowiki></code>
*Diff with version 10000001:<br/><code><nowiki>http://en.wikipedia.org/w/index.php?diff=100000001&oldid=123456789</nowiki></code>
*To show only a diff and not the page content, add <code>&diffonly=1</code> to any of the above:<br/><code><nowiki>http://en.wikipedia.org/w/index.php?diff=cur&oldid=123456789&diffonly=1</nowiki></code>

A shorter alternative to link to the diff with the previous version is:
*<code><nowiki>http://en.wikipedia.org/wiki/?diff=12345678</nowiki></code>

=== Internal links ===
Although external links are easy to copy and paste, they can be long and unwieldy. Diffs can be wikilinked using [[Special:Diff/''<code>diff</code>''<nowiki>]] (e.g. </nowiki>[[Special:Diff/123456789]]) or [[Special:Diff/''<code>oldid</code>''/''<code>diff</code>''<nowiki>]] (e.g. </nowiki>[[Special:Diff/100000001/123456789]]) where you should replace ''<code>oldid</code>'' and ''<code>diff</code>'' with appropriate values seen in the URL. This syntax is easy and can even be used in [[WP:EDSUM|edit summaries]].

=== <nowiki>{{Diff}}</nowiki> ===
Using {{tl|diff}} is another method of linking to a diff within Wikipedia, though it cannot be used in edit summaries. The general syntax is:
:{{tlx|Diff|''page''|''diff''|''oldid''|''label''}}
*{{para|''page''}}&nbsp;– The title of the page.
*{{para|''diff''}}&nbsp;– The ID or keyword that is used against the base ID. Possible keywords are:
**<kbd>cur</kbd>&nbsp;– compare with the current (latest) version of a page.
**<kbd>prev</kbd>&nbsp;– compare with the previous version of a page.
**<kbd>next</kbd>&nbsp;– compare with the next version of a page.
**''id''&nbsp;– This should be ''larger'' than <kbd>oldid</kbd>.
*{{para|''oldid''}}&nbsp;– The base ID onto which the diff is generated.
*{{para|''label''}}&nbsp;– Text to display as link. No label will give a numbered link.
*{{para|diffonly|yes}}&nbsp;– Shows only a diff and not the page content. Parameter name required.

==== <nowiki>{{URL to diff}}</nowiki> ====

{{Tl|URL to diff}} takes a full diff URL and converts it to a {{Tl|Diff}} template. The template should be substituted, thus:

:<code><nowiki>{{Subst:URL to diff|url=http://en.wikipedia.org/w/index.php?diff=100000001&oldid=123456789|label=relevant text}}</nowiki></code>

==Deleted revisions==
A '''deleted revision''' is to a version of an article that for some reason has been made "invisible" to the general public. This is occasionally done for reasons like significant copyright violations, disruption, or personal attacks on other Wikipedia contributors.

An administrator can see deleted revisions and related 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 visible to them. It is possible for an administrator to restore a deleted revision if warranted.

See [[Wikipedia:Revision deletion]] for further details.

== Weave 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 can still compare moved paragraphs, even if weave-moved over 20 paragraphs away. Prior to August 2018, a diff could be kept clearer (simpler), by first using a separate edit to insert blank lines plus move the text paragraphs, then after saving, in further revisions, add or change text within the moved paragraphs. Only if paragraphs are both split and reworded in the same revision, then the specific new words cannot be individually highlighted as different from the prior revision. A split paragraph will typically highlight the 2nd part(s) as if new text on the page. The weave-diff can compare paragraphs word-for-word if moved, but not if split.

A diff shows differences per line, so it synchronizes between revisions by matching the [[newline]]s and unchanged lines. Some editors find that having additional line breaks to break up the text improves the diff function. Otherwise, those large, massive globs of text can be difficult to compare after a split. Keep sentences limited in length, such as with four prepositions, and seek shorter paragraphs. Long [[wp:reftag]] footnotes ({{tag|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 [http://wikipedia.ramselehof.de/wikiblame.php?user_lang=en&lang=en&project=wikipedia WikiBlame] tool, which automates this searching process.

== Format for displaying a diff ==
In the case of the Classic [[Wikipedia:Skin|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 [[URL]]s (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 glossary}}
*[[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!
*[[User:Cacycle/wikEdDiff]] — an alternative and often easier to read diff for registered users
*[[Template:Wiki diff]] — for simulating diffs
*[[Meta:Help:Diff]], briefly mentioning diffing separate pages
*[[Special:ComparePages]]
*[[Special:MobileDiff/16784261...710255994|Special:MobileDiff/''id1''...''id2'']]
*[[Help:Permanent link|Special:Permalink/''oldid'']]
*[[WP:Provide diffs]]
{{Help navigation}}
{{Wikipedia technical help|collapsed}}
[[Category:Wikipedia page history help|Diff]]

[[de:Hilfe:Versionen#Versionen vergleichen]]
Anonymous user

Navigation menu