Skip to content

Instantly share code, notes, and snippets.

@sonsongithub
Created March 17, 2015 07:10
Show Gist options
  • Save sonsongithub/32aa13cfa382f97da94b to your computer and use it in GitHub Desktop.
Save sonsongithub/32aa13cfa382f97da94b to your computer and use it in GitHub Desktop.
post-commit script for 2tch
#!/bin/bash
GIT_MARKETING_VERSION=`git describe --abbrev=0 --tags`
GIT_REVISION=`git rev-parse --short HEAD`
GIT_COMMIT_TIMES_STRING=`git log --since=2000-01-01 --oneline --no-merges | wc -l`
let GIT_COMMIT_TIMES=GIT_COMMIT_TIMES_STRING+13000
cat > ./2tch/info.prefix <<EOT
#define GIT_MARKETING_VERSION ${GIT_MARKETING_VERSION}
#define GIT_REVISION ${GIT_REVISION}
#define GIT_COMMIT_TIMES ${GIT_COMMIT_TIMES}
EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment