summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup_environment3
1 files changed, 3 insertions, 0 deletions
diff --git a/setup_environment b/setup_environment
index e5cd4fa..65f8340 100644
--- a/setup_environment
+++ b/setup_environment
@@ -7,10 +7,13 @@ export GPGPUSIM_ROOT="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )"
GPGPUSIM_VERSION_STRING=`cat $GPGPUSIM_ROOT/version | awk '/Version/ {print $8}'`
#Detect Git branch and commit #
+CURRENT_PWD=`pwd`
+cd $GPGPUSIM_ROOT
GIT_COMMIT=`git log -n 1 | head -1 | sed -re 's/commit (.*)/\1/'`
GIT_FILES_CHANGED=`git diff --numstat | wc | sed -re 's/^\s+([0-9]+).*/\1./'`
GIT_FILES_CHANGED+=`git diff --numstat --cached | wc | sed -re 's/^\s+([0-9]+).*/\1/'`
GPGPUSIM_BUILD_STRING="gpgpu-sim_git-commit-$GIT_COMMIT-modified_$GIT_FILES_CHANGED"
+cd $CURRENT_PWD
echo -n "GPGPU-Sim version $GPGPUSIM_VERSION_STRING (build $GPGPUSIM_BUILD_STRING) ";