Packfiles use delta compression to store repositories more compactly, but the deltas are not at all related to commits. The objects (blobs, trees, etc.) are sorted for similarity, completely ignoring the graph of commit history and completely ignoring filenames or directory structures, then delta compression is applied. This allows git’s storage to be smaller than version control systems that use a storage structure that preserves history or filenames.
> Packfiles use delta compression to store repositories more compactly, but the deltas are not at all related to commits. The objects (blobs, trees, etc.) are sorted for similarity, completely ignoring the graph of commit history
While I understand this point, I would make two further ones:
- The storage is still diffs, and definitely not snapshots. It's just that the diffs of which a given commit consists do not all refer to the same "base". Contrasting git with a system in which commits are stored as one large diff (whereas git stores them as many small diffs) is something you can do, but it's not the same thing as contrasting git with a system in which commits are stored as snapshots. (Whereas git stores them as diffs.)
- "Sorting for similarity" isn't a thing you can do; similarity does not induce a consistent ordering.
> This allows git’s storage to be smaller than version control systems that use a storage structure that preserves history
This is worded unfortunately; git wouldn't be a version control system at all if its storage structure didn't preserve history. It does, but it doesn't mix that concern with its concern for file contents.
Well snapshots and lists of all the diffs to apply in order (so long as there are no conflicts) are equivalent, but there are important ways that git is fundamentally based on snapshots rather than diffs. A simple example is that rebasing changes the revision id and snapshot even if the diff doesn’t change, or that rerere exists. If snapshots were equivalent to diffs then this wouldn’t need to be the case: just do set union in the world of diffs.