Executive summary

The public git repositories served up on gitweb are maintained by a simple script, called git-mirror.rb. This script pulls all heads matching certain patterns from the internal repository. By default, branches fitting the following criteria will be mirrored:

  1. the master branch (master),
  2. standard nightly build tags, of the form YYYY-M[M]-D[D][_X*],
  3. branches whose names end with -publicbranch,
  4. nightly build tags that end with -publicbranch and a build date,
  5. release tags, and
  6. explicitly whitelisted branches (currently V7_5-dcloud-branch and V7_1-procd_osg-branch)

Frequently-asked questions

Where is all of this stuff? See pinguino:/scratch.2/git for the scripts and the gitweb installation.

How often does this thing run? The old shell-script version ran once every twenty minutes as a cron job. The new Ruby version pulls all matching branches, sleeps for thirty seconds, and then runs itself again; it uses cron essentially as a watchdog. (That is, at most one mirror job targeting a given destination repository will run at a time.)

When should I expect to see my changes to a mirrored branch reflected in the public repository? A pull shouldn't take more than five minutes, so the worst-case scenario for the new mirror script is probably under ten minutes. (The real worst-case scenario involves waiting for the cron job to restart git-mirror.rb, but your average wait time in that case should still be under fifteen minutes.)

How can I tell if my (sensitive) branch will be mirrored to the public repository? You can run git-mirror.rb yourself on your personal repo with the --dry-run option, and it will show you the list of branches and tags it would have pushed, given the default options.

How can I tell if my (non-sensitive) branch will be mirrored to the public repository? Push it to the main internal repo and wait for at most fifteen minutes.

How can I recognize an additional set of branch or tag names to be mirrored to the public repository? The first question to ask yourself is "do I really need to do this?" Unless you're dealing with something inflexible that expects a certain kind of branch or tag name, it's better to use a name that already fits one of the existing patterns. However, it's easy to make the script recognize additional patterns: simply specify the additional pattern as a command-line argument to git-mirror.rb in the crontab entry: use -p REGEX to specify that head names matching REGEX should be pushed or -w NAME to add NAME to the name whitelist.

What else can I do with this script? Glad you asked! Run git-mirror.rb --help for more details.