3 ms·
Naive question Can't we call Github a monorepository, as it is a single area one can use to access code? Implementation details likely differ from whatever Go
by tomrod 7y ago
Naive question
Can't we call Github a monorepository, as it is a single area one can use to access code?
Implementation details likely differ from whatever Google and her engineers are cooking up, but at the end of the day I point to an archive and pull artifacts. Certainly not every Googler clones the entire monorepo...
- alexhutcheson 7y agoGitHub isn't a monorepo because you can't change multiple projects with a single commit. In a monorepo you can do things like change a function signature and change all of its callers in one commit, without breaking anyone's build. If the implementation and its callers live in different projects within GitHub, then you can't do this safely, and you need to do more work to provide backward- and forward-compatibility in your changes.
- CydeWeys 7y agoThis is very important. When you're developing a large monorepo like Google3 you frequently get large scale changes from engineers outside your team, doing exactly these kinds of large scale reactors. It puts the onus of fixing things on the people making changes in the widely used libraries rather than separately on all the individual library users, which is great. It's way more efficient to have one person who knows exactly what's changing go fix it everywhere than require dozens or more separate engineers to have to investigate some new incompatibility and then potentially resolve it in sub-optimal ways.
- juiyout 7y agoIn your example (change a function signature and change all of its callers in one commit), would it require code reviews and approvals from every affected projects?
- alexhutcheson 7y agoYes, although if you can prove convincingly that it's a 100% safe change you can often get approval from someone who has approval power for most of the repository. In practice, if you're changing 100+ individual callsites, then you would probably make a backwards-compatible change, then use an automated system to send out and manage a bunch of different commits to clean up call sites, then clean up your old function signature once all the commits are submitted. If your code isn't a really widely used library then you probably have fewer than 20 callsites, though, so it's nice to be able to do it in one commit.
- deleted 7y ago[deleted]
- dilap 7y agoCan’t branch or monotonically commit across repos, so I’d say not really.
- cipherzero 7y agoI’m not sure I understand what branching monotonically means, could you explain that? I’m not disagreeing with you - but is this something that can be done with googles monorepo? And when would I want to do so?
- dilap 7y agoHa, sorry! I meant to say "atomically commit", but my brain mixed it with mono-repo, to come up with monotonically, which is a math word w/ no relevance to branching (afaik!) For branching, I just meant there's no easy way to branch everything at once. If you want to have "weirdExperiment" branch that affects code in 4 repos, you have to go branch 4 different times. For committing, same deal. You can't easily tag a single snapshot of the state of all projects. Etc.
- daxelrod 7y agoIn a monorepo, it’s generally possible to have one version identifier that describes the state of all the code in it. Additionally, you generally get more flexibility of how to slice and dice your view of the repo, rather than being locked into code boundaries that were set once and are difficult to change.