Help:Diff: Difference between revisions
Evilphoenix (talk | contribs) copyediting |
TRANSWIKI: Copied from Meta:Help:Diff. |
||
Line 1: | Line 1: | ||
{{h:h|reader toc}} |
|||
<-[[Help:Contents]] |
|||
A '''diff''' is the difference between two versions of a page. It can be viewed from the [[Help:Page history|page history]]: for every version there are potentially two [[w:radio button|radio button]]s: the left column is for selecting the older version, the right column for selecting the newer one. Pressing "Compare selected versions" gives the difference between the two versions. |
|||
For special cases (the diff for a single edit or between an old and the current version) other possibilities are clicking ''cur'' or ''last'' in the page history or on the [[Help:Recent changes|Recent Changes page]]. The diff is also shown during an [[Help:Edit conflict|edit conflict]] so you can see exactly what you need to reintegrate. |
|||
⚫ | The two versions are shown side-by-side. |
||
{{H:new| diff works also in preview, showing the difference between the currently stored version and the current version in the edit box}} |
|||
==How it looks == |
|||
⚫ | The two versions are shown side-by-side. In the old version paragraphs which differ are yellow and the new version is they are green. In left-to-right languages, the old version on the left. This is reversed in [[m:RTL|right-to-left]] scripts. Text removed within a paragraph is shown in red on the old version. New text within a paragraph is shown in red on the new version. If a whole paragraph was removed or added, the text is not red but just black, while the other side is blank (white). Unchanged text is black on grey, only parts before and after changed text is shown. |
||
The diff shows differences per line. Some editors find that adding manual line breaks improves the diff function. |
The diff shows differences per line. Some editors find that adding manual line breaks improves the diff function. |
||
As well as showing the difference between versions, the diff page has links to the user page and talk page of the users |
As well as showing the difference between versions, the diff page has links to the user page and talk page of the users who edited both the last and current versions. Links to the users' contribution lists are also shown. For sysops, a [[Help:Reverting a page to an earlier version|rollback]] button is shown allowing them to revert from the new version to the old one. Note however that this is even shown when viewing the diff between the recent version of a page and a version older than the last version by an author other than the one of the most current version, in which case the rollback would not undo the change that is displayed. Thus if user A vandalized a page, and user B partially reverted that vandalism, the diff of the two together shows the remaining vandalism, but rollback reverts the partial repair by user B! |
||
[[Help:Edit summary|Edit summaries]] are also shown on the diff page. These appear in the row beneath the user names. If the user has used links in their edit summary, these act as links on the diff page as well. |
[[Help:Edit summary|Edit summaries]] are also shown on the diff page. These appear in the row beneath the user names. If the user has used links in their edit summary, these act as links on the diff page as well. |
||
In 1.4 there are also links to both versions, and the previous and next diff. |
|||
This example shows the top of the diff page, with the links described above. |
This example shows the top of the diff page, with the links described above. |
||
Line 20: | Line 27: | ||
| |
| |
||
<strong>Revision as of 00:10, Aug 18, 2003</strong><br/> |
<strong>Revision as of 00:10, Aug 18, 2003</strong><br/> |
||
[[User:Tim Starling|Tim Starling]] ([[User_talk:Tim Starling|Talk]] | [[Special:Contributions/Tim_Starling|contribs]]) '''[ |
[[User:Tim Starling|Tim Starling]] ([[User_talk:Tim Starling|Talk]] | [[Special:Contributions/Tim_Starling|contribs]]) '''['''''[[Main Page|rollback]]''''']'''<br/> |
||
Reverted edits by Angela to last version by Anthere |
Reverted edits by Angela to last version by Anthere |
||
|} |
|} |
||
Line 30: | Line 37: | ||
After the table of differences, the latest of the two compared versions is shown fully. |
After the table of differences, the latest of the two compared versions is shown fully. |
||
In the case of the |
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. |
||
⚫ | |||
⚫ | |||
==URL== |
|||
To do a comparison with the older page rendered below the table of differences, provide the URL as follows. |
|||
Open the revision of one page that you wish to compare to another, for example <code><nowiki>http://meta.wikimedia.org/w/index.php?title=Help:Diff&oldid=78722</nowiki></code>, and the revision of the other page that you wish to compare, for example <code><nowiki>http://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=98420</nowiki></code>. Copy the oldid number of one page (<code>&oldid=78722</code> in the first example) and replace the text <code>oldid</code> with <code>diff</code>: <code>&diff=78722</code>. Paste this string into the URL of the other page between that page's title and its oldid (<code>&oldid=98420</code> in the second example), so you have something like this: |
|||
:<code><nowiki>http://meta.wikimedia.org/w/index.php?title=Main_Page&diff=78722&oldid=98420</nowiki></code> |
|||
You may remove the page title (<code>title=Main_Page</code> in the example above) from the URL if you wish, but this is not necessary. The resulting diff will compare the given versions of the two pages [http://meta.wikimedia.org/w/index.php?title=Main_Page&diff=78722&oldid=98420]. |
|||
To compare the current version of the page and a given oldid, you can put "current" after "diff=" instead of an oldid. For example, |
|||
⚫ | |||
<code><nowiki>http://meta.wikimedia.org/w/index.php?title=Help:Diff&diff=current&oldid=124558</nowiki></code> |
|||
would compare the current version of this page with the version that has oldid 124558. |
|||
⚫ | |||
==External link== |
==External link== |
||
*http://cvs.sourceforge.net/viewcvs.py/wikipedia/phpwiki/newcodebase/DifferenceEngine.php |
*http://cvs.sourceforge.net/viewcvs.py/wikipedia/phpwiki/newcodebase/DifferenceEngine.php |
||
{{h:f|langs=|enname=Diff}} |
Revision as of 21:55, 24 November 2005
A diff is the difference between two versions of a page. It can be viewed from the page history: for every version there are potentially two radio buttons: the left column is for selecting the older version, the right column for selecting the newer one. Pressing "Compare selected versions" gives the difference between the two versions.
For special cases (the diff for a single edit or between an old and the current version) other possibilities are clicking cur or last in the page history or on the Recent Changes page. The diff is also shown during an edit conflict so you can see exactly what you need to reintegrate.
How it looks
The two versions are shown side-by-side. In the old version paragraphs which differ are yellow and the new version is they are green. In left-to-right languages, the old version on the left. This is reversed in right-to-left scripts. Text removed within a paragraph is shown in red on the old version. New text within a paragraph is shown in red on the new version. If a whole paragraph was removed or added, the text is not red but just black, while the other side is blank (white). Unchanged text is black on grey, only parts before and after changed text is shown.
The diff shows differences per line. Some editors find that adding manual line breaks improves the diff function.
As well as showing the difference between versions, the diff page has links to the user page and talk page of the users who edited both the last and current versions. Links to the users' contribution lists are also shown. For sysops, a rollback button is shown allowing them to revert from the new version to the old one. Note however that this is even shown when viewing the diff between the recent version of a page and a version older than the last version by an author other than the one of the most current version, in which case the rollback would not undo the change that is displayed. Thus if user A vandalized a page, and user B partially reverted that vandalism, the diff of the two together shows the remaining vandalism, but rollback reverts the partial repair by user B!
Edit summaries are also shown on the diff page. These appear in the row beneath the user names. If the user has used links in their edit summary, these act as links on the diff page as well.
In 1.4 there are also links to both versions, and the previous and next diff.
This example shows the top of the diff page, with the links described above.
Revision as of 22:32, Aug 03, 2003 Angela (Talk | contribs) |
Revision as of 00:10, Aug 18, 2003 |
When moving or copying a piece of text within a page or from another page, and also making other edits, it is useful to separate these edits. This way the diff function can be usefully applied for checking these other edits.
Width
After the table of differences, the latest of the two compared versions is shown fully.
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.
Page widening is more likely on a diff page, because there are two columns, but also because URLs (especially long ones) are not hidden.
URL
To do a comparison with the older page rendered below the table of differences, provide the URL as follows.
Open the revision of one page that you wish to compare to another, for example http://meta.wikimedia.org/w/index.php?title=Help:Diff&oldid=78722
, and the revision of the other page that you wish to compare, for example http://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=98420
. Copy the oldid number of one page (&oldid=78722
in the first example) and replace the text oldid
with diff
: &diff=78722
. Paste this string into the URL of the other page between that page's title and its oldid (&oldid=98420
in the second example), so you have something like this:
http://meta.wikimedia.org/w/index.php?title=Main_Page&diff=78722&oldid=98420
You may remove the page title (title=Main_Page
in the example above) from the URL if you wish, but this is not necessary. The resulting diff will compare the given versions of the two pages [1].
To compare the current version of the page and a given oldid, you can put "current" after "diff=" instead of an oldid. For example,
http://meta.wikimedia.org/w/index.php?title=Help:Diff&diff=current&oldid=124558
would compare the current version of this page with the version that has oldid 124558.