puppetlabs/puppet — pull request #1286 by jeffmccune (2012-11-19 15:41:24+00:00)
Title: Improve Puppet.version API to help automate releases

Without this patch applied, it is difficult to fully automate releases
because the `PUPPETVERSION` constant in code must be updated, creating a
new version of the code. This circular dependency makes it very
difficult to use `git describe` as the basis for a version string.

This patch addresses the problem by providing a way to break the
circular dependency. With this patch applied, Puppet will use the
contents of `lib/puppet/VERSION`, if it exists, as the version string.
This VERSION file is not intended to be version controlled therefore
changing it does not create a new version in history as does changing
the code itself.

This patch defines the public API to maintain the software version for
package maintainers. This should make things really easy to automate in
a fully backwards compatible manner, like so:

$ git describe --match "3.0.*" > lib/puppet/VERSION
$ ruby -r puppet/version -e 'puts Puppet.version'
3.0.1-260-g9ca4e54