astropy/astropy-helpers — pull request #16 by mdboom (2014-05-21 15:11:35+00:00)
Title: Use rev-list --count rather than just rev-list

Since we don't actually need the whole `rev-list`, just the number of hashes in the `rev-list`, using `rev-list --count` is a lot faster.

On my machine, this is the bulk of the wall-clock time spent in `setup.py` before handing off to distutils, so I got about a 30% speedup until that point.

(The `submodule status` call is still more expensive than this one, but I don't see any way around it.)