summaryrefslogtreecommitdiffstats
path: root/git-desc
blob: b5dd0c5ad32f4009a1e8cf4d70fd3156a3ea66ac (plain) (blame)
1
2
3
4
5
6
7
8
9
#! /bin/sh

tag=$(git describe --tags HEAD 2> /dev/null || \
      git rev-parse --short HEAD)
dirty=$(git update-index --refresh --unmerged > /dev/null
	if git diff-index --name-only HEAD | read dummy; then
	    echo -dirty
	fi)
echo $tag$dirty