We are using Git with a central server, and our code needs to include a version number in a file. The way this is currently done is like this:
- A new developer does a "git clone"
- In his local copy, he edits .git/hooks/pre-commit to call version.sh
version.sh (which is included in the project root) takes a version number from "git describe" and stores it in a file.
While this works, I would like to make sure that the version number is updated even if a developer forgot to edit his pre-commit hook.
Since the server has no working copy, simply calling the (pre|post)-receive hooks there does not work, so I am wondering if there is a way to do this.