137 points · by Amorymeltzer · 6y ago · 64 comments
[1]: https://github.com/microsoft/VFSForGit
[2]: https://news.ycombinator.com/item?id=14411126
[3]: https://devblogs.microsoft.com/bharry/the-largest-git-repo-o...
It's also I'd imagine not mutually exclusive effort. It seems like exactly like something you would want in combination with something like VFS at scale, as it reduces the number of materialized versus virtual objects in both the git working copy and the git object database. If you've got millions or billions of objects and files, even reducing the number of virtual placeholders I would imagine is probably a big win.
Also remember that there are many Git clients that work with normal Git repos. Like libgit and others. I doubt you'll see wide spread support for it unless MS can upstream it into the main Git implementation, and maybe some the the primary libraries.
This is one nice argument for Mercurial, where there is only a single implementation, so adding big new changes can be easier.
Golang should have figured this out from day 1 before shipping with a release system built around cloning a repo in its entirety, history and recursive submodules, and all.
Also, would emulating this command with a repo of submodules not work?
Monorepos should be straightforward unless you are managing the code of >1k engineers.
IME, most consternation comes from people adopting a mono repo without adopting a build/dependency graph tool (like Bazel, buck or pants).
An additional source of strain is from people abusing the repo (checking in large binaries, third party dependencies, etc).
A third is when people try to do branch-based feature development, instead of the “correct” practice of only deploying master (or weekly cuts of master).
I think even a simple list of these sort of “gotchas” would be valuable for the aspirational mono repo company.
My impression is that a lot of teams hit these early and painful roadblocks, and imagine that they’ll never go away (they do!!).
That seems like a build problem, not a Git problem.
> An additional source of strain is from people abusing the repo (checking in large binaries, third party dependencies, etc).
That is not necessarily abuse. In fact, it is a good practice in many cases!
> A third is when people try to do branch-based feature development, instead of the “correct” practice of only deploying master (or weekly cuts of master).
I am not sure what you mean by branch-based development, but I don't see why that would be a specific problem of monorepos.
A monorepo is just 1 repo. There is nothing more straightforward than that.
It sounds good except for this part.
Most of my code (dating from before git was around) for various projects is in a single subversion tree and I check it out using git or mercurial to provide for local version control.
Features like sparse checkout are definitely welcome in git since the industry seems to have standardized on it.
In any case, with SVN you usually do not want to give write perms to everyone in all the tree, so you end up with effectively partitioned spaces, or you make several repos instead, or you put another layer on top. With Git, anyone can easily develop global commits.
If we're talking project-wide repos rather than entire-org repos, I'd wager the vast majority of projects can use monorepos without special git tooling, and will retain huge productivity benefits vs app/package-per-repo organisation.
As an individual, I have switched to a mono repo for all of my Common Lisp code and with some adjustments to my Quicklisp configuration I am very happy with my setup.
I am a programming language junkie, and I have it on my low priority todo list to switch to a mono repo for Haskell, Racket, and Hy language (Lisp with a Clojure syntax that sits on top of Python).
I worked as a contractor at Google in 2013 and I absolutely loved their mono repo and web based development environment. I really miss that.
EDIT: my overall concern is that it looks like people are reinventing clearcase. Please speak to an older developer who worked at an HP/IBM type company in he late '90s/early 2000's before you do that. Please!
In fact, it’s not just useful for the CI/CD pipeline - any developers making significant changes to base libraries or core infrastructure should be able to use the VFS in combination with a system like Bazel to run all (or a significant sample of) affected tests across the company.
All I have is this thread: https://lobste.rs/s/fosip5/should_version_control_build_syst...
At HP we had some in-house perl-script wrappers around the raw clearcase tools that fixed many of these problems. The developers of those scripts had all left to go work for Rational (makers of clearcase), and I don't think anyone really knew how they worked. We also had a full-time clearcase engineer that kept the servers running. Fortunately our smallish projects didn't need the full power of clearcase and those perl scripts kept working fine for us. I did alway wonder what would happen if the one guy who understood the servers left the company.
In short, it's a complex and powerful tool that very few people really understood. Very few projects need all that power and complexity. I'm sure Microsoft and Google benefit from complex version control tools and have engineers to spare for managing and understanding them, but I don't think any open source projects or smaller companies are really going to benefit from "clearcase for the modern age" type tools.
For instance, if you need a single file/directory from another project in your repository.
Basically sparse checkout only populates the tree for the dependencies we want, and then git-lfs will only download the binaries that are present in the current worktree.
Works out pretty well.
Keep in mind though that sparse checkout still has the entire repository loaded in the `.git` object store, it just doesn't expose it in the worktree.
> This combination speeds up the data transfer process since you don’t need every reachable Git object, and instead, can download only those you need to populate your cone of the working directory
If you're only downloading what you need to populate the working directory how is it that `.git` will have the entire repository?
Edit:
wrowclif@wrowclif-desktop:~/Taccs2/p5_deps$ git grep "def returnValue"
twisted/install_linux_gcc54/lib/python2.7/site-packages/twisted/internet/defer.py:1350:def returnValue(val):
twisted/install_linux_gcc54/lib/python2.7/site-packages/twisted/internet/test/test_win32events.py:66: def returnValueOccurred(self):
twisted/install_win64_vc141/lib/python2.7/site-packages/twisted/internet/defer.py:1350:def returnValue(val):
twisted/install_win64_vc141/lib/python2.7/site-packages/twisted/internet/test/test_win32events.py:66: def returnValueOccurred(self):
twisted/vendor_base/src/twisted/internet/defer.py:1350:def returnValue(val):
twisted/vendor_base/src/twisted/internet/test/test_win32events.py:66: def returnValueOccurred(self):
wrowclif@wrowclif-desktop:~/Taccs2/p5_deps$ ls ./twisted/
install_linux_gcc54Git’s partial clone is a more natural way of achieving the same outcome.
The last time this happened to me, I took it as a hint that I had split the repositories along the wrong lines. The repos should probably be either merged or divided further to prevent this.