by zmmmmm · 1mo ago · 0 comments
The first thing that hits me is, did you consider not going all in on a monorepo? I know it has been the trend in general, but it seems a bit of a red flag when you go from "let's have a monorepo it will make merging easier" to "let's redesign version control because merging is too hard now" without the middle question "should we really have a monorepo?"
As a derivative thought I'm curious if AI tooling is tipping people more towards monorepos now since it gives the agent the whole context of the app in one go? Or is this independent - I can easily check out 5 repos in one directory and run an agent there.
We never allow textual conflicts, but semantic conflicts (for example, if someone adds changes the logic of a function and cleans up all affected callsites concurrently with a new call being added) are an unavoidable fact of very large repos unless you completely serialize merging with running extensive validation at the proposed batch tip, which isn't practical at a certain commit rate.
As for cross-repo changes, not exactly, but there are ways we could allow such a thing if we wanted. We're thinking about it.
An entire dept exists to make it work. Atomicity and security are other arguments. The larger the company, the stronger the incentive.
It's not something average software developers working elsewhere care about much.
Amazon seems to be the only big company bucking this trend.
Besides, agents really fly when the whole project fits comfortably in their context window. You get all these nice interfaces to bound context with if the API's and public types are defined and versioned separately from each team's repo.
An agent swarm has a very different set of problems. There can be a lot more agents making changes in parallel than you'd see in all but the biggest megacorps, and the pace of those changes can be ridiculously high. The rapid pace simultaneously balloons the total repo size (because of history), and the frequency of collisions. A modifies file 1, B modifies file 1, A commits changes, B runs into conflict. Or worse, C modifies file 1 after A commits their changes and beats B to commit, resulting in B growing staler and staler as they race to get their branch merged.
"The traditional approach to marriage didn't work for us. But then we realized that co-habitating (or even living near each other), sharing resources, and even communicating with each other are goals that don't apply to everyone. That's how we invented the 'live 500 km apart and never communicate with each other again' style of marriage, and it saved our relationship."
I'm exaggerating, of course. Slightly.
Doing it like that works, but then you end up doing all the cross-repo concerns in every single repo. I don't think the savings in history are all that much anyway - yes, you save on the rarely modified repos but the heavily modified repos still have a similar amount of changes.
Everything works like this in the end at some level. I assume people with monorepos don't retest their project on every Linux kernel commit - it's pointless, you are never going to run against exactly that commit. But you will do it when you do upgrade Linux versions, etc.
I never got caught into the monorepo fad, I'm glad I didn't, and I still don't see a point in having monorepos. Let's say in ruby on rails, I have the host app and 3 mounted gems in it. That's 4 repos. It could be all merged into one monstrosity but separate repos help keep complexity down, and help define interdependencies cleaner and simpler.
The monorepo idea was just a fad. Each package should be its own repo. Each package should be meaningfully useful, e.g. one package for string utils, not one package for trim, one package for pad, etc.