News for hackers. Stuff that matters.
Re:On Monolithic Repositories by jcranmer on Wednesday August 05, 2015 @01:21AM (#10008138)
I'm very much a fan of monolithic repositories, because I have had horrible experiences working with project-based repos. I've been around long enough to recall discussions of why people should stop using CVS, and invariably one of the bullet points on that list is "CVS lacks atomic commits." Projects that use multiple repositories invariably fall into the trap of having non-atomic commits, and people who advocate multiple repositories have likely never had the fun task of trying to do archaeology on those repositories where the sudden non-atomicity is suddenly painful.

When I've brought this up before, people occasionally mention submodule or subrepositories, and those are equally broken. It makes big assumptions about how you're going to be organizing repositories (i.e., a strict tree), and if your design is not in that organization scheme, you're up a creek. For practical development, the subrepo tree effectively becomes one monorepo anyways: touch the innermost subrepo, and now you need to add a commit to all the outer repos to update the newer version of the innermost subrepo.

A saner way to handle repos is to recognize that it's not necessary for people to have the full history of everything in the repository stored on their local machine most of the time. This is something that SVN does better--you can checkout subdirectories of an SVN repo, but the commits are still atomic across the entire repository.

Re:On Monolithic Repositories by bluesnowmonkey on Wednesday August 05, 2015 @01:18PM (#10011285)
Beyond a certain scale, atomic commits don't work in monolithic repos either. If a big commit touches code in many areas, it needs to be broken up into many small commits, so that experts in each of those areas can review, rework, and approve those changes without tripping over each other. Those small commits won't all happen at the same time, so they need to be backward compatible. Now depending on the tooling, you're back to essentially the same workflow you'd have with many repos.

Granted, this is based on experience at several startups and a single huge company with a famous monorepo. Maybe there is a size in the middle where a single dev can still understand all the code well enough to make a sweeping commit without breaking lots of things.

Re:On Monolithic Repositories by warkid on Wednesday August 05, 2015 @08:13AM (#10009152)
> A saner way to handle repos is to recognize that it's not necessary for people to have the full history of everything in the repository stored on their local machine most of the time.

Local history enables rebasing. Of course you can do it without local history already present, say in SVN you'd use separate branches for changes and 'rebased' changes where you merge your work on top of some new state of trunk. But this involvs creating branches(and at cleast one checkout for separate branch folder) and communicating with the server(takes time). This all means that people almost never do this. With git rebase is a snap. But of course one can live without rebase, it's not oxygen or something.

Re:On Monolithic Repositories by jcranmer on Wednesday August 05, 2015 @08:37AM (#10009266)
You can download the history you need for rebasing when you do the rebase command, in effect turning the local .git (or .hg) store into basically a local cache of a remote repository.