Sometimes "git pull --rebase" fails with:
fatal: BUG: get_tempfile_fd() called for inactive object
(I cannot get it to fail for me.) Recent changes to git made
pull a built-in C program rather than a shell script, and perhaps
the new reference locking code is being tickled badly. So
for now, change this to
git fetch && git rebase
which is essentially what the old shell script based "git pull"
would do here (though of course it had to do it the very long
way around, but we should be fine with this short way).
Use $GIT_REF_PATH, if it is set, to look for reference
clones when doing repo checkouts.
Reference clones are much faster. In a new, empty build
tree, doing a full clone in my test took over an hour
of real time (1:03:14.36). Switching to using --reference,
referring to an existing build tree's _BE directory, took
under 3-and-a-half minutes (3:28.50) in one test, and about
5 minutes in another. That is, about 12 to 18 times
faster. (Details will depend on your network speed.)
User and system CPU time also dropped dramatically:
user=448.977 sys=536.946 seconds (no reference)
user=132.858 sys= 20.595 seconds (first ref test)
user=173.599 sys=25.108 (second, 5 minute, clone).
To use this effectively we will need to provide a
location for base reference clones. They should
probably be updated frequently, e.g., via cron jobs;
a stale reference still works but becomes less effective.