Hacker News new | ask | show | jobs
by fiddlerwoaroof 55 days ago
It can get even smaller when loose objects get packed into packfiles because of delta compression: a whole bunch of identical files can be stored in minimal overhead over storing one copy.
2 comments

Right, packfile size is really what matters in the long-term. A tiny change to a file in the short term just adds the whole thing again (compressed), whereas a tiny change in a packfile shouldn't add much at all. Unless you've got very limited disk space, the long-term is the only size that matters.
> whereas a tiny change in a packfile shouldn't add much at all

Well to the extent that git is able to find a suitable delta, which is the difficult part.

I think the 250 files all containing just "foo" are stored as a single blob, too, even before creating a packfile.
I forgot about that, delta compression still can save quite a bit when you have nearly-identical files.
Exactly, a tiny change in a large file produces a full new blob, but is stored very efficiently as a delta in a packfile.