Add script to find current HEAD for build
Add script that, when run from the root of the repository, returns the sha1 hash of the current branch head. It writes the hash to stdout if successful or returning non-zero otherwise. The three methods used to get the hash are as follows: 1. Try using the git tools. This is the preferred method since the layout of the .git directory may change (not likely to happen soon, but it did change a few years ago). 2. Failing that, assume the current (1.7.x) repository layout and try to extract the value of HEAD. 3. If there is no .git directory, try extracting the hash from the VERSION file in the top-level directory of the tree. Also add the VERSION file and set the export-subst attribute for it.
Showing with 52 additions and 0 deletions