Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 23 lines (20 sloc) 0.867 kb
66457bf Uli Kusterer Updated Versioning for Git:
authored
1 #
2 # Run this file as part of your build process to extract the latest
3 # revision from your Git working copy and create a 'svn_version.h'
4 # file defining a SVN_VERSION constant to that value.
5 #
6 # This is for a user-visible build number, so we use the number of revisions
7 # and not the actual git hash.
8 #
9 # The file will be created in the current directory and the subversion
10 # revision number is extracted from the current folder's .svn/entries
11 # file.
12 #
13
14 echo -n "note: Finding revision in "
15 pwd
16 revnum=`/usr/local/git/bin/git rev-list HEAD | /usr/bin/wc -l | sed -e 's/^ *//g;s/ *$//g'`
17 fullrevnum=`/usr/local/git/bin/git rev-parse HEAD`
18
19 # Now write the constant declaration to the file:
20 echo "#define SVN_VERSION \"$revnum\"" > svn_version.h
21 echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
22 echo "note: Wrote revision $revnum to svn_version.h"
Something went wrong with that request. Please try again.