4 ms·
I"m not sure why it's misleading? I said smallest/simplest/fastest. Fastest is fulltext or pointers to existing objects. Smallest is deltas from other objects
by DannyBee 3y ago
I"m not sure why it's misleading?
I said smallest/simplest/fastest.
Fastest is fulltext or pointers to existing objects. Smallest is deltas from other objects.
If your complaint is that i'm somehow implying it's file based, i'm not. But as we'll see, your claim that it stores complete exact snapshots is wrong. It is correct at the UI level, but we aren't talking about the UI level, but the storage level. Git is object based, where most objects are files are directories, and it does in fact choose between fastest/smallest/simplest to decide how to represent changes between trees. One way it reduces space is to be copy-on-write, which is why it doesn't store exact snapshots.
I do know git (at the ui level) is snapshot based - i worked on VC systems for about a a decade, and remember when git was born. I also used to sit next to Shawn Pearce (RIP :( )and Junio Hamano's office for 7 or 8 years, so i acquired lots of git knowledge by osmosis.
On my own I go far enough back to have watched Graydon work on monotone before rust ;)
You are correct it is a snapshot based VC, but all parts of the storage are implementation details as well.
The last non-snapshot based VC to have serious followership was CVS, which used individual RCS files and non-atomic commits.
With atomic commits came snapshots.
Even SVN was a snapshot based VC as well - SVN servers stored things abstractly the same as Git does - each commit was a copy of the entire FS, with pointers to unchanged objects.
More importantly Git is copy-on-write, so it also doesn't store the complete exact snapshot of the entire repository. it stores the changed objects since the last tree, with pointers into that last tree for unchanged objects.
So what you wrote is not correct either.
This is why, say, corruption in older commits can break newer commits.
This is also theoretically an implementation detail. As mentioned SVN had an FS abstraction that presented each commit to the rest of the system as a copy of the filesystem, like git does. The different storage backends under FS chose to store the FS in different ways - some deltas, some plaintext, some pointers to existing plaintext.
However, none of these VC would be really useful if they didn't trade time for space. If they actually stored "a complete exact snapshot", the space usage would be insane.
To whit - a "complete exact snapshot of the entire repository" would be space-prohibitive. the kernel tree has over 1 million commits and the tree is ~4 gigabytes. Without some of the "implementation details", it would be unusable (since this is 4PB, i'm going to assume the fact it was smaller in the past is in the noise).
All storage in VCen is an implementation detail. Git exposes its implementation details more to users than others do.
Git doesn't really have clean abstractions, and because it abstraction breaks at various levels, it's hard to talk about in the way we are here without saying something that is "wrong" at some level.
For example, git is really object based, not snapshot based, at the lower levels. It's basically an object store of different types of objects, some of them trees, etc. To the user, it appears mostly snapshot based, but you can go mess with the objects in various ways.
SVN (again, for example), has as it's main abstraction is an FS snapshot, and the files/directories/things in it. There is no access to a lower level abstraction like you can in git.
This is actually snapshot based - there is no abstraction breaking.
- DannyBee 3y agoPut another way - if you think about something similar with cleaner abstracts - we'll use an FS with O(1) snapshots (BtrFS, ZFS, etc) At the UI layer - to the user they see a snapshot as a complete, exact copy of the filesystem for each snapshot. How this happens is an implementation detail. As far as the user is concerned the system is storing a complete, exact copy of the FS at each snapshot. At the FS layer, is a snapshot stored as a complete, exact copy of the filesystem? Absolutely not :) It is stored as a pointer to some root object most of the time. If you go further down, the objects may or may not be stored complete. They may be compressed. They may have portions of the object shared with other objects (dedupe and block cloning/sharing), etc. As you go further down the abstractions, at some point it's not an implementation detail but instead fairly fundamental to the system. In this case, as with git, the system could not afford to store complete exact copies of the FS, even if it had a way of doing so in O(1) time, which isn't possible in our universe anyway.
- searealist 3y agoYeah, I know your username, and I'm sure you understand git internals and CAS, etc. I still think your post is misleading to readers as most will walk away thinking git is stacking up deltas on each commit. This is evidenced by three people trying to correct you in this thread. Regarding CAS/CoW, I don't think that is any less of a complete exact snapshot. There are no deltas involved, and the representation is completely independent of any other commits (other than the parent commit hashes).