Add getrevision.sh utility script.

This allows to retrieve various data from SCM systems (git and svn) and
use them in the build process to better indicate which source was used.
For now only use it for the upstream (i.e. svn) revision number, which
was previously implemented by an awful line in the Makefile.

Signed-Off-By: David Hendricks <dhendrix@google.com>
Improve getrevision.sh.

 - remove bashism
 - simplify some git-related code
 - there is only one sane time format.
 - vastly improve git_url() to print the correct remote url and
   "nearest" branch
 - add "-dirty" to local revisions if there are uncommitted changes
 - indicate in local revisions how many git-only commits were done
   since branching from upstream svn
 - fix svn_revision() fallback to svn info and remove git-svn
 - print leading r in script instead of hardcode it in the makefile;
   no more "0.9.7-runknown"
 - Make retrieving the upstream revision work even in cloned git-svn
   repositories.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Generate more detailed version information.

Signed-Off-By: David Hendricks <dhendrix@google.com>