3 # Inspired by linux-2.6/scripts/setlocalversion
11 if [ ! -d .git ]; then
14 head=$(git rev-parse --verify --short HEAD)
15 printf "~git-%s" "$head"
16 # Check for uncommitted changes
17 if git diff --name-only HEAD | read dummy; then
23 [ -f "$FILE" ] || touch "$FILE"
25 old_version=$(< "$FILE")
26 version=$(printf '"%s"\n' "$(compute_version)")
28 if [ "$version" != "$old_version" ]; then
29 echo "$version" > "$FILE"