From PdxWikiWednesday
Jump to: navigation, search

A diff is a special kind of web link (URL) on a wiki. The name reflects the fact that it shows the "diff"erence between two versions of a wiki page.

On most wikis, every time somebody changes a page, the old version is preserved; all different revisions are available in the "history" tab at the top of the page. A "diff" is a way to look at two specific versions and figure out what somebody did.

The anatomy of a diff

Here is an example of a diff between two revisions of the a wiki page:

(NOTE: must find a good example)

If you click on the link above, you'll see two columns; the column on the left represents the older of the two versions, the one on the right the newer version. Each column gives you some basic information at the top: who made the edit, their edit summary, and links that make it easy to find the newer and older diffs, or undo the revision.

Then there is some text in each column -- only a few lines surrounding each area that was changed. The specific changes are highlighted in red.

Below all that, you'll see the newer of the two versions of the page in its entirety.

What diff does it make?

You might wonder, what's the big deal with a diff? Well, diffs are useful in many ways!

One important use is two people are using the wiki to collaborate, refining a document, and wanting to have a dialog about the changes each is making to the document. Bob might be writing Sue an email, and might want to say "I don't understand why you made this edit -- can you explain?" If Sue had made 20 different changes, that question might be difficult for Sue to interpret -- which edit did Bob mean? But with a diff linking directly to the precise edit in question, she would know exactly what he meant. So Bob would paste the diff right into the email message to communicate exactly what he was talking about.

Another use is fending off vandalism. On the Dreamfish wiki, we're pretty well surrounded by well-intentioned people; but sooner or later, somebody will come along and make a mess of things, just because they can. But it's no big deal; some diligent wiki gardener patrolling recent changes will undoubtedly spot the unusual behavior, check the diff(s), and revert the vandal's edits.

And another great use -- especially for new wiki users -- is learning little tricks with wiki code. Did somebody make a neat table on a wiki page, or do a bit of formatting you didn't realize was possible? If you find the right diff, you can see exactly how they did it, and use the same technique in your own editing!

Where can I get my very own diff?

You, too, can find diffs, and use them for whatever you want! The easiest way is to go into the history tab of any page (for instance, click "history" above on this page).

In the list of revisions, at the beginning of each line you'll see links that say, in plain English ;), "cur" and "prev." These stand for "current" and "previous." If you click "cur," it will show the diff between that revision and the current revision of the page; clicking "prev" shows the diff between that revision and the one immediately before it.

You can get other diffs too, by clicking the radio buttons and clicking the "compare selected versions" button.

Once you're at the page, just copy the URL out of your web browser's address bar and paste it wherever you like -- on a wiki page, in an email, or even in your pocket if you can figure out how!

Congratulations, you're now the proud owner of your very own diff.

Sloppy diffs and fuddled communication

Since diffs are an important foundation for clear communication on a wiki, it's useful to keep them clean and straightforward when possible. For this reason (and others), wiki editors are encouraged not to get too particular about inconsequential stuff like extra line breaks, the number of spaces after a period, etc. If you're editing a page that has more line breaks than you'd use, for example, it's often best to just leave that part of the page alone.

See also

  • edit summary - Writing good edit summaries is a good way to help people understand what you're doing without them having to dig through all the diffs.