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.