summaryrefslogtreecommitdiffstats
path: root/Modules/describe.sh
blob: 6425ed521885ff067953436539eb913ae681b30f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# Check for git and a git repo.
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
	/bin/echo -n `git describe`

	# Are there uncommitted changes?
	git update-index --refresh --unmerged > /dev/null
	git diff-index --quiet HEAD || /bin/echo -n -dirty
else
# Check for version tag
	if [ -e version.tag ]; then
		/bin/echo -n `cat version.tag`
	fi
fi

echo