Make scripts/version work in shallow clones
Shallow clones don't have tags. Use git describe --always --dirty in such cases. XXX Add branch name.
This commit is contained in:
1 parent
89809a2d0f
commit
f7bf9a8e96
1 file changed
+7
-2
+7
-2
@@ -1,5 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
cd `dirname "$0"`
|
cd `dirname "$0"`
|
||||||
git rev-parse --verify -q jq-1.0 > /dev/null 2>&1
|
if git rev-parse --verify -q jq-1.0 > /dev/null 2>&1; then
|
||||||
git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'
|
git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'
|
||||||
|
else
|
||||||
|
b=`git rev-parse --abbrev-ref HEAD`
|
||||||
|
c=`git describe --always --dirty`
|
||||||
|
echo "${b}-${c}"
|
||||||
|
fi
|
||||||
Reference in new issue
Block a user