News for hackers. Stuff that matters.
Re:Why Google Stores Billions of Lines of Code in a Single R... by bedros on Tuesday July 24, 2018 @10:43PM (#17606568)
how do you create branches in mono repo?

for example I want to use branch rev5 from project A and rev3 from project B

how I do that in a mono repo, I could not do it in HG, but sure about GIT

Re:Why Google Stores Billions of Lines of Code in a Single R... by aidos on Wednesday July 25, 2018 @02:44AM (#17607305)
Depends on the system. When I used to manage SVN we would branch independent projects and then releases would be a snapshot of each into the server section of the repo. Those were then pulled down to their respective machines.

In SVN a branch is simply a convention. You copy (almost zero cost) things around into your branches directory

Re:Why Google Stores Billions of Lines of Code in a Single R... by tom_ on Wednesday July 25, 2018 @06:31AM (#17608205)
Branch rev5 of project A's folder into a folder in your project's folder, branch rev3 of project B's folder into a folder in your project's folder. Get your project to refer to its own copy, rather than the shared copies you branch from. (This isn't quite like git submodules, but that's probably the closest thing git has.)

You do the usual 3-way merge thing to push your changes upstream, or pull upstream changes into your copy. As with git, the VCS tracks which revision of upstream your copy is up to date with, which is how it determines the base for the 3-way merge.

Re:Why Google Stores Billions of Lines of Code in a Single R... by Tloewald on Tuesday July 24, 2018 @11:02PM (#17606641)
Can’t you create a branch and merge the two branches you are interested in into that?
Re:Why Google Stores Billions of Lines of Code in a Single R... by bedros on Wednesday July 25, 2018 @12:14AM (#17606869)
my understanding, if you branch, you branch the entire repo, (not sure about some special case extensions ) if you have two projects stored in a single repo, you are forced to use whatever rev at for each project at a point of branch rev 5543 for example
Re:Why Google Stores Billions of Lines of Code in a Single R... by ScottBurson on Wednesday July 25, 2018 @12:44AM (#17606953)
In Perforce, which is more or less what Google is using, you can branch any directory within the repo. (You would never branch the whole repo; that makes no sense.) So if you wanted to construct a directory with one version of one subdirectory, and a different version of another subdirectory, that's quite straightforward.
Re:Why Google Stores Billions of Lines of Code in a Single R... by ec109685 on Wednesday July 25, 2018 @01:32AM (#17607085)
Google branches google for releases. Otherwise, you would end up with version skew across dependencies, which would be a mess.
Re:Why Google Stores Billions of Lines of Code in a Single R... by Too on Wednesday July 25, 2018 @03:46AM (#17607547)
Yep, and if you want to keep folders you didn't branch up to date with master you have to continuously rebase.

Not having it this way would be equivalent to having subrepo that refers to HEAD instead of a specific commit which is normally considered an big anti-pattern.

The best remedy is to not do branching like this in the first place, just try to stay on trunk all the time.