From 22a0d67c0fc7daf18280d3b7e938be8442102110 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky <pfalcon@users.sourceforge.net> Date: Mon, 5 May 2014 01:00:21 +0300 Subject: [PATCH] py-version.sh: Make it work in case no git tag is present. --- py/py-version.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/py-version.sh b/py/py-version.sh index 42474ef6a..daa25489e 100755 --- a/py/py-version.sh +++ b/py/py-version.sh @@ -1,6 +1,7 @@ #!/bin/bash -git_tag="$(git describe --dirty || echo unknown)" +# Note: git describe doesn't work if no tag is available +git_tag="$(git describe --dirty 2> /dev/null || git rev-parse --short HEAD)" git_hash="$(git rev-parse --short HEAD 2> /dev/null || echo unknown)" git_files_are_clean=1 # Check if there are any modified files. -- GitLab