kyle has asked for the wisdom of the Perl Monks concerning the following question:
After a romp through some SuperSearch results (and a read through Perl Best Practices), I wound up coding my $VERSION like this:
use vars qw( $VERSION ); use version; $VERSION = qv( (qw$Revision: 1.1 $)[-1] );
...where $Revision: 1.1 $ is something that's maintained for me by the revision control system I'm using.
Recently, I decided to start using git for revision control (having written some Perl to replay my old history into it). Since git is distributed, it really can't give me revision numbers in files like CVS can, so I'm looking for a new way forward.
I'm far too lazy to remember to update one of those numbers every time I touch a module, but I would like them to stay up-to-date. How do others handle this? How do you get a worthwhile version number into your programs and modules without any discipline or other noticeable effort?
The only solution I've thought of is a local commit script. It would determine which files have changed since the last commit and update their version numbers before running a git commit. This wouldn't be too hard to implement, and the habit of using it wouldn't be hard to form. Even so, I'm wondering if there is an even better way. Can I slip in another few lines in place of my $Revision$ hack and get what I want?
All your wisdom will be greatly appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Best Practice for automatic version numbers? (no, how)
by tye (Sage) on Oct 06, 2007 at 03:22 UTC | |
by kyle (Abbot) on Oct 06, 2007 at 03:55 UTC | |
Re: Best Practice for automatic version numbers?
by perlfan (Vicar) on Oct 06, 2007 at 03:19 UTC |