#!/bin/bash
+# Inspired by linux-2.6/scripts/setlocalversion
+
set -e
FILE=localversion
fi
head=$(git rev-parse --verify --short HEAD)
printf "~git-%s" "$head"
+ # Check for uncommitted changes
+ if git diff-index --name-only HEAD | read dummy; then
+ printf '%s' "-dirty"
+ fi
+
}
[ -f "$FILE" ] || touch "$FILE"