Skip to content

Commit

Permalink
Add git-version post-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKepzie committed Mar 7, 2014
1 parent bf1b93c commit ddda081
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .git-hooks/git-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

export LANG=C

OUTPUT_DIR='.'
BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`
COMMIT_ID=`git rev-parse HEAD`
VERSION="$BRANCH_NAME - $COMMIT_ID"
cat > "${OUTPUT_DIR}/Global/GitVersion.h" << EOF
#ifndef NATRON_GITVERSION_H_
#define NATRON_GITVERSION_H_
#define GIT_BRANCH "$BRANCH_NAME"
#define GIT_COMMIT "$COMMIT_ID"
#endif
EOF
exit
2 changes: 2 additions & 0 deletions .git-hooks/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
`dirname $0`/git-version

0 comments on commit ddda081

Please sign in to comment.