My question is more general than declared in title.
I know that source version control stores information only about differences. As I understand so does Wikipedia, and so does github.
But they all have ability to show whole file with particular revision. Do they incrementally restore it from first revision to specific one?
And another one question. If they store differences only, how they show them in ui with context (little bit text before and after changes).
EDIT: github stores whole snapshots instead of deltas
I know that source version control stores information only about differences.
As the question Git design decision on storing content rather than differences illustrates, this isn't exactly what Git does.
It does has "packed" format though, to store objects in deltaified form, using binary delta from LibXDiff library. But that mainly is used for network transfer.
See "Is the git binary diff algorithm (delta storage) standardized?".
That is why git is "resolving delta" when you fetch.
For a very interesting read about the pros and cons of different ways of storing version control data I highly recommend reading Eric Sink's article Time and Space Tradeoffs in Version Control Storage.
Storage is one of the most difficult challenges for a version control system. For every file, we must store every version that has ever existed. The logical size of a version control repository never shrinks. It just keeps growing and growing, and every old version needs to remain available.
So, what is the best way to store every version of everything?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With