From b64b24b7a0cfbbf8eca8ec2520f78ee7345102dc Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 18 Oct 2009 20:38:39 +0200 Subject: [PATCH] version-gen.sh: Append '.dirty' to the version number if appropriate. --- version-gen.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/version-gen.sh b/version-gen.sh index 5b9c171..8797e49 100755 --- a/version-gen.sh +++ b/version-gen.sh @@ -1,11 +1,16 @@ #! /bin/sh -DEFAULT_VERSION="0.0.0" +DEFAULT_VERSION="0.0.0.git" VERSION="$( git describe 2> /dev/null | sed -e 's/foobar-//' )" if test -z "$VERSION"; then VERSION="$DEFAULT_VERSION" +else + git update-index -q --refresh + if test -n "$( git diff-index --name-only HEAD )"; then + VERSION="$VERSION-dirty" + fi fi VERSION="$( echo "$VERSION" | sed -e 's/-/./g' )" -- 2.30.2