4 ms·
They are separate problems and not really comparable, git is a higher level tool. The diffing in git is for humans to compare code, and as such it is actually c
by mindwok 4y ago
They are separate problems and not really comparable, git is a higher level tool. The diffing in git is for humans to compare code, and as such it is actually computed on the fly and not stored anywhere (unless you use git patch). Similarly, git does not provide any mechanism for sending/receiving files, it re-uses existing solutions like HTTP and SSH.
This tool exists to send/receive files, and the diffing is an implementation detail used to achieve a high level of performance. It would make more sense for git to use this library under the hood as you mentioned.
- geokon 4y agoOh right, git doesn't store diffs. So each time you push/pull, it fetches/uploads the whole file.. for every commit? Damn.. Then I guess even using this under the hood would be essentially a rewrite or how git fundamentally works internally
- pornel 4y agoThere is git-pack which compresses similar files together.
- rkangel 4y agoThere is an analogy here, as git does deduplication 'under the hood'. It's kind of weird actually - at the architectural level we interact with, we talk in terms of diffs - both in terms of display and what we put in. At the next level down (content addressable store) git is storing whole files, and the git tooling translates the diffs we communicate about down into whole files for each commit. Then at the next level down, git puts files together in packfiles (when the repo is packed) which is a compression system to make use of the fact that most files are just tweaks of other files. So, once again it's diffs.
- planede 4y agogit does store deltas, but it's an implementation detail. This is what git pack files mostly are. I don't know if git sends or receives deltas though, I think it does?