Remix.run Logo
▲ fiddlerwoaroof 8 hours 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.

▲gblargg 5 hours ago | parent | next [-]

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.

▲masklinn 4 hours ago | parent [-]

> 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.

▲bewuethr 6 hours ago | parent | prev [-]

I think the 250 files all containing just "foo" are stored as a single blob, too, even before creating a packfile.

▲fiddlerwoaroof 5 hours ago | parent [-]

I forgot about that, delta compression still can save quite a bit when you have nearly-identical files.

▲bewuethr 5 hours ago | parent [-]

Exactly, a tiny change in a large file produces a full new blob, but is stored very efficiently as a delta in a packfile.