build: more support for old git.

git rev-list has no --count, and doesn't take args with values in two parts

(integrated from komodo (trunk) change r85596 by marky)

git-svn-id: http://svn.openkomodo.com/repos/openkomodo/trunk@14395 b87d16e7-d29f-4ee1-b5ec-817d645d335f