I tried making a few branches and some dummy commits and I agree that
this behavior seems a little better, though I can't say the old way
bothered me. TBH I don't understand why generate-version is trying so
damn hard when all it needs is a unique build stamp.
But hopefully nobody will say that this change is bad "because reasons".
During development you can install the SBCL that has uncomitted changes,
commit them, rebuild, reload older contribs, etc without getting an error.
Seeing the different version string is potentially useful to know what
you've done, but failure to load a fasl per se could be a hindrance.
Sometimes larger build systems contain copies of SBCL sources, if those
systems are managed with git, we don't want to trample version.lisp-expr
with _their_ version, but keep the version of SBCL.
Attempt to detect this by checking whether
`git rev-parse --show-top-level`/run-sbcl.sh exists, if not assume git
is operating on a checkout of something other than SBCL
Make it work with detached heads and historical builds.
Previously a detached head broke the build, and trying to
do
git checkout master; git reset --hard sbcl-1.0.50; sh make.sh
got the version number wrong.
Pre-1.7.2 Gits are pretty common out in the wild, so use wc -l to
get the revision counts instead of rev-list --count.
This has been verified to work with at least Git v1.6.0.2.
This updates the SBCL build and release process to be more compatible
with distributed development -- to facilitate moving the upstream
repository into Git.
A detailed description of what is going on here is in
doc/GIT-WORKFLOW.md.
Some highlights:
* Drop version.lisp-expr and branch-version.lisp-expr.
* Auto-generate the version at build time using information
from Git, incorporating:
- Last release number.
- Number of commits on origin/master since last release.
- Current branch, if there are commits not on origin/master.
- Number of commits not on origin/master.
- SHA1 id of the last commit.
- Optional -dirty marker.
* Update release.sh to work with Git.
* Make source-distribution.sh exclude the .git directory from tarballs.
* Release tags contain NEWS for that release.