in reply to GIT source code variables question?
I asked a similar question in Best Practice for automatic version numbers? Basically, there wasn't a great answer, but you might find it interesting anyway.