5 ms·
git stores diffs, but the usual operations are between commits, which resolve to a snapshot, yes. but there are operations that get the diffs (interactive reba
by pas 3y ago
git stores diffs, but the usual operations are between commits, which resolve to a snapshot, yes.
but there are operations that get the diffs (interactive rebase for example)
so, git, in typical UNIX fashion, is a bit of this and that, a very useful collection of tools to work on a repository, under some allegorical unification umbrella.
- j16sdiz 3y agogit 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.