Sign in to PrePAN

App::Git::AutoVersion Use git's smudge and clean filters to automatically update version strings

In Review


# In shell:
# $ cd my_git_workdir
# $ 1|0


This dist will provide a script that sets up automatic version string generation for source code, using a template. $AUTOVERSION$ is proposed.

Whenever $AUTOVERSION$ is encountered, it gets substituted with git describe --tags minus the trailing shasum, eg v0.9.1.0. A safe fallback is set up incase no tags exist.

An added bonus is that every commit following a tag, will append a running number to the versionstring, ie next commit it will be v0.9.1.0-1, then -2, etc. until next tag.

The dist would also provide scripts to do the actual filtering, to be used by the filers.


This certainly sounds like a useful facility. If it's all going to be accessed via scripts then perhaps putting it under App:: might be semantically better - there are a few git-related dists in there already.

How will this identify strings which should be modified as opposed to version numbers intended to stay static (such as in documentation)?
Should definitely go to App:: , I updated it accordingly. Also changed it to $AUTOVERSION$ which is more in line with comparable keyword expansion.

As for the other question, I dont know. It certainly needs to be configurable on a per-file basis. Which filters are. But best bet would be to come up with notation that is the least likely to collide with any existing syntax.

Please sign up to post a review.