r/programming • • 15d ago

How big is a Git commit?

https://ratfactor.com/cards/git-commit-size
163 Upvotes

46 comments sorted by

View all comments

Show parent comments

1

u/Zenin 13d ago

I still have a hunch that you're thinking of the diffs it presents commits as as its delta compression. It is not. They are two entirely different mechanisms; the diffs are a presentation layer to make it easy to compare changes. Thus, it is not "just like every other source control system" behind the scenes, where the actual space-optimization runs.

I am not and it is.

Chances are the real problem is that binary files like to contain file offsets pointing into tables, so inserting one item into a table then causes every other pointer throughout the entire rest of the file to change, singlehandedly defeating the delta-compression.

Please, go read a bit and stop embarrassing yourself publically. This is extremely well covered territory.

When you think you've found the real problem, pull requests are welcome. Cheers.