When I was getting the code in the previous post ready to share, I ran into a problem: my checkouts of LLVM and Swift were shallow clones, i.e. git repositories that don’t store the full history of each branch. Working with those locally is surprisingly easy; trying to set them up on a server using git push
is a bit trickier. While trying to figure out what was going on, I was dismayed by the lack of up-to-date documentation about shallow repositories, even on my usual go-to site, git-scm.com. So here’s a collection of information I’ve gathered about shallow repositories.
Shallow Git Repositories
HTTPS and Name-based Virtual Hosting
If you’ve been running your own server for a while, eventually you’ll start getting privacy jitters and want to use HTTPS, at which point you’ll either happily set it up with minimal difficulty (if you’re running a single site) or realize frustratedly that you can’t use HTTPS with name-based virtual hosts. To quote the Apache site:
The reason is very technical, and a somewhat “chicken and egg” problem. The SSL protocol layer stays below the HTTP protocol layer and encapsulates HTTP. When an SSL connection (HTTPS) is established Apache/mod_ssl has to negotiate the SSL protocol parameters with the client. For…