Skip to content
Browse files

Output from make_git_version.sh is now prettier and includes a build …

…date constant.
  • Loading branch information...
1 parent 9263044 commit 29823db3e27dd4abf62dfc04e7826673ff29e9f0 @uliwitness committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 make_git_version_header.sh
View
6 make_git_version_header.sh
@@ -42,9 +42,11 @@ echo -n "note: Finding revision in "
pwd
revnum=`/usr/local/git/bin/git rev-list HEAD | /usr/bin/wc -l | sed -e 's/^ *//g;s/ *$//g'`
@caius
caius added a note

fwiw, tr is usually a nicer way to delete whitespace than a regex - git rev-list HEAD | wc -l | tr -d ' '

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
fullrevnum=`/usr/local/git/bin/git rev-parse HEAD`
+builddate=`date "+%Y-%m-%d"`
# Now write the constant declaration to the file:
-echo "#define SVN_VERSION \"$revnum\"" > svn_version.h
-echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
+echo "#define SVN_VERSION \"$revnum\"" > svn_version.h
+echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
echo "#define SVN_VERSION_NUM $revnum" >> svn_version.h
+echo "#define SVN_BUILD_DATE \"$builddate\"" >> svn_version.h
echo "note: Wrote revision $revnum to svn_version.h"

1 comment on commit 29823db

@uliwitness
Owner

thanks, fixed that when you told me on Twitter.

Please sign in to comment.
Something went wrong with that request. Please try again.