One nit: If it turns out we aren't in a git tree, I think that `rev-parse` command will emit a fatal error to stderr, which will look scary. (thanks to the `if toplevel` it'll still work correctly).

I'm not sure how big a deal this is.. I'd like to test it manually first to see how frequently it comes up. This function might be called only as a last resort, in which case it'd probably be ok. If/when we add support for other VC systems, it may happen more frequently (as this routine gets called when we're actually in an hg or SVN tree or something).

The fix would probably be to add a `hide_stderr=True` option to `run_command()`.