Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've read recently that Lion uses version control that tracks changes (deltas), not files (SVN). Has the technology behind this feature been published? I'd assume that it is either Git, Hg, Bazaar, or a custom variant of those but that's completely speculative.

Quote from above link:

OS X Lion is smart enough to only track and record the changes between different copies of documents. This means that 400 full copies aren’t saved, just the partial changes from version to version.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Something completely different.

Ars Technica's Lion Review goes into this in detail. (See Here)

Basically it chunks files, looks for chunks that differ, and stores those in an SQLite database. (CoreData uses SQLite) A separate DB is used for tracking all the different revisions and which chunks go with which revisions.

The engine that handles the chunking is semi-intelligent too. It can crack some file formats (e.g. JPEG images, PDF files, MPEG audio/video files, etc.) and separate out the various blocks within, then look for changes within those. That prevents a change in a video header from generating a cascade of changes that bloats the delta storage unnecessarily.

Also of note: An app that wants to use this versioning system must be written to do so. It's not automagic by default, nor is every file on the filesystem versioned in with this framework.

One thing I've thought of that I haven't yet seen addressed: Is it possible to "pin" particular versions of files? The Ars review indicates that Lion's gernerational storage framework automatically ages out old revisions. Is there a way to tell the OS that a particular version is important enough to keep indefinitely?

share|improve this answer
Awesome answer. They've basically primed versioning for primetime by alleviating the issues with non-text files. Very interesting! –  Nic Jul 20 '11 at 16:48
@melee: Rolling hashes, sliding/variable windows, and cracking file formats for efficient delta handling aren't new. However, it appears to be well done, which has been Apple's forte lately. If the API is sane, I think we'll see developers jumping onboard with this really quickly. –  afrazier Jul 20 '11 at 16:56
@afrazier To the best of my knowledge: provided the file system supports permanent version storage, command-s Save a Version should suffice. If a file system lacks support for permanence, the application or operating system should present advice. In Apple Support Communities I posted a little about the Transparent App Lifecycle (auto save, versions, resume) and permanent version storage. –  Graham Perrin Jul 30 '11 at 19:36
@melee: “The issues with non-text files” in version control aren't necessarily about storing deltas! Rather, files that aren't human-readable and don't have handy linebreaks are hard to diff (to review what changed) and 3-way merge (to combine independent changes into one new version). No clever algorithm can solve this; it requires the systems responsible for diff/merge to be extensible to work with the non-text format. Or, one can omit diff and merge and only present historical snapshots, as I assume Apple's system does. –  Kevin Reid Jul 31 '11 at 23:34
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.