2011/10/28 pasman pasmański <pasman.p@gmail.com>:
> I think, it be useful to include in version() function a hexadecimal
> identifier of commit, for fast checkout to it in git.
It's sort of impossible to make this accurate, though. You may have
patched your tree but not created a commit with those changes before
you build; or if you have created a commit it may very well not be one
that's in the public repo, but just something on our system.
Moreover, there's no real guarantee that you're compiling from a git
tree at all; you could well be compiling from a tarball.
All in all I feel like this is a solution in search of a problem.
People shouldn't be using anything other than a released version in
production, or if they do, they should take it upon themselves to
version-stamp it appropriately. An automated solution will probably
not be reliable, and probably will create all sorts of build-system
headaches.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company