Analogies for Git (2016)
novalis.org
novalis.org
It doesn't usually compute differences. It doesn't store deltas, although it seems to do so to the newly acquainted user.
Git is a highly configurable folder backup program, that allows for sharing that folder with the world.
- Is it just a diff with paths and specific line numbers?
- Does it contain a few lines of context to heuristically map the diff onto the right place in case unrelated lines are added/removed?
- What other data structures are needed to produce a snapshot? Is it just a graph of change sets?
Git has a pack file format that stores deltas but that is just for space saving.
1. Some "human" metadata such as message, author, timestamps
2. An ordered list of parents (0 to infinity parents)
3. A complete directory tree of the repository at that version.
So when you reference a commit in Git you aren't referencing a diff/changeset. You are referencing an exact snapshot of the files in the repository at that time. This is sometimes obscured because to a human we often find it useful to see what changes a commit introduced. For example if you run `git show $commit` in the simple case where $commit has exactly one parent Git will compute a diff between $commit and its parent ($commit~1). However logically this diff isn't stored as part of the repository, it is computed on the fly from the snapshots of the two directory trees.
If you want to re-apply it to a different version of the repo (usually via `git cherry-pick`) Git basically does two steps:
1. Compute the diff between the commit and its parent.
2. Apply that diff to the target revision.
Of course this all gets more complicated in the case of merge commits (commits with >1 parent) but the model is similar.
(For performance reasons Git does use delta compression internally but that is just an optimization and doesn't really reflect the diffs that humans are interested in).
Also I wouldn't be surprised if it does improve run time by using the disk cache more effectively
Storing changesets can handle very very large sets of files much more easily, but you pay the price with having to compute what file is stored whem which lengthens check out time even in the small. It is not a good trade off if you have to check out the entire thing anyways. This is why get is more popular with the open source community which is more like a bazaar than a cathedral
Now where are the hevc and av1 of versionning system ?
That's how the git backend works for most of its storage.
It's a fool's errand to look at the conceptual model and start making claims about performance.