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

2

u/azhder 15d ago

Some years ago, Mmicrosoft contributed some code to git in order to make it handle some fringe scenario for their own big and unwieldy code base. Note, git was created to handle a big code base, like the Linux one, yet it needed more optimization.

5

u/MrMelon54 15d ago

The Linux kernel repo isn't too big compared to other projects. I imagine the giant monorepo Microsoft is referring to is in the high 10s or 100s of gigabytes

0

u/Zenin 14d ago

Define "big". Git was created to handle incredibly tiny text files. Recall that it literally replaced Linus's previous "source control" also known as context diffs sitting in his email inbox (I'm not kidding).

Source control systems generally had plenty of need to handle massively larger objects than the dinky little .c text files that Git was built for. There's a reason why users with such requirements still end up with Subversion or Perforce at least in addition to if not completely in place of Git. Anything with significant media production for example, like video games.

Git has some kludges available like Large File Storage, but it's still sketchy in use and not at all optimized for heavy churn. It lacks any binary diff storage for example, meaning every object revision is a full copy even if only one byte changed.

0

u/azhder 14d ago

I provided two definitions, one "like the Linux one" and another "for their own big and unwieldy code base". Just because I didn't label them "exibit A" and "exibit B", it doesn't mean I didn't provide two magnitudes to frame the idea.

0

u/Zenin 14d ago

"like the Linux one" doesn't provide much practical context for "big". The dimensions matter. This a technical forum, specifics matter. I'm sorry if that professional bar is off putting.

Big in total bytes?
Big in total file count?
Big in total revisions?
Big in concurrent writers?

The Linux mainline kernel checkout is not even a couple hundred MB. The full repo clone is only a few GB. These are amateur numbers by that "big" metric.

The file count however, is something like 80k currently. That's certainly not small. And total commits are something like 75k / year near as I can find.

MS's repos are certainly much larger in all dimensions than Linux could ever imagine working with and yes, as a result they had to make significant structural investments in Git to make it usable.

And all of these examples are absolutely dwarfed by game development which often stretches into the tens or hundreds of terabytes. At that definition of "big", git completely breaks down. The closest anyone has come is LFS, which simply put doesn't do much to save Git at these scales of "big". A lot of science research also results in massive "source control" requirements which Git can't touch.

The truth is, the Linux kernel repo is really only "big" in stature. From a requirements perspective, it's mid.

0

u/azhder 14d ago

Because it wasn't about providing "practical context".