diff --git a/share/genbuild.sh b/share/genbuild.sh old mode 100644 new mode 100755 index d959877..507e334 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -15,8 +15,13 @@ if [ -e "$(which git)" ]; then # clean 'dirty' status of touched files that haven't been modified git diff >/dev/null 2>/dev/null - # get a string like "v0.6.0-66-g59887e8-dirty" - DESC="$(git describe --dirty 2>/dev/null)" + # Try exact tag match first (when building from a release tag) + DESC="$(git describe --tags --exact-match 2>/dev/null)" + + # If no exact match, fall back to git describe with commit distance + if [ -z "$DESC" ]; then + DESC="$(git describe --tags --dirty 2>/dev/null)" + fi # get a string like "2012-04-10 16:27:19 +0200" TIME="$(git log -n 1 --format="%ci")"