X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=GIT-VERSION-GEN;h=1056b7c817f8578348120f64ad7047754bf688df;hb=c401cb48e77459a4ccad76888ad31bef252facc5;hp=7763639a82bf7e2d4ccef8d2795b9e9dda197e9b;hpb=181129d24c83bfcbaa438579c5d3cd2531755232;p=git.git diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 7763639a..1056b7c8 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,15 +1,26 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.1.GIT +DEF_VER=v1.2.GIT # First try git-describe, then see if there is a version file # (included in release tarballs), then default -VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || -VN=$(cat version) || -VN="$DEF_VER" +if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then + VN=$(echo "$VN" | sed -e 's/-/./g'); +else + VN=$(cat version) || VN="$DEF_VER" +fi VN=$(expr "$VN" : v*'\(.*\)') + +dirty=$(sh -c 'git-diff-index --name-only HEAD' 2>/dev/null) || dirty= +case "$dirty" in +'') + ;; +*) + VN="$VN-dirty" ;; +esac + if test -r $GVF then VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)