summaryrefslogtreecommitdiff
path: root/tools/setlocalversion
diff options
context:
space:
mode:
Diffstat (limited to 'tools/setlocalversion')
-rwxr-xr-xtools/setlocalversion3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/setlocalversion b/tools/setlocalversion
index b3f5f2824b..e11f54f55a 100755
--- a/tools/setlocalversion
+++ b/tools/setlocalversion
@@ -13,7 +13,8 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
# Do we have an untagged version?
if git name-rev --tags HEAD | \
grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
- git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+ (git describe || git describe --tags || git describe --all --long) \
+ 2>/dev/null | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
fi
# Are there uncommitted changes?