4 ms·
git don't really store diffs. It is a mix of both. Unpacked commits are snapshots.
by j16sdiz 3y ago
git don't really store diffs. It is a mix of both.
Unpacked commits are snapshots.
- andrewaylett 3y agoLayers of abstractions. From the outside, we see diffs (or checked out trees). Looking at the next layer in, every file in every commit is present in the DAG. Then the storage layer deduplicates and packs similar blobs as binary diffs. It's quite neat, the object DAG is the canonical representation, but we can optimise on one side for efficient storage and on the other side for our preferred visual representation. Both without particularly needing to worry about the canonical representation being an abstraction, as it's quite good at not being a leaky abstraction.