The ant target set-revision-number depends on the checkout being a subversion checkout. Since there now is a mirror of Alfresco Community on Github this target fails if the checkout (clone) is not a subversion checkout.
The attached patch will check if the checkout is subversion or git by checking for the .svn and .git folder in project root. Using this we can determine what scm tool is used and set the revision number for the build accordingly.
It also adds an echo to display the retrieved revision number (or commit hash in case of git).