aboutsummaryrefslogtreecommitdiff
path: root/scripts/git_hash.sh
blob: 48ae24e74fe1344e45928e4081b0c7795726a0df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

if [ -z ${1} ]; then
	echo "should be called with a path"
	exit
fi
ROOTDIR=${1}

repo=https://git.linaro.org/lng/odp.git
if [ -d ${ROOTDIR}/.git ]; then
	hash=$(git describe | tr -d "\n")
	if git diff-index --name-only HEAD &>/dev/null ; then
		dirty=-dirty
	fi

	echo -n "'${repo}' (${hash}${dirty})">${ROOTDIR}/.scmversion
fi

cat ${ROOTDIR}/.scmversion