]> granicus.if.org Git - jq/commitdiff
Make configure.ac work for shallow clones
authorNicolas Williams <nico@cryptonector.com>
Sun, 5 Mar 2017 04:57:14 +0000 (22:57 -0600)
committerNicolas Williams <nico@cryptonector.com>
Sun, 5 Mar 2017 04:57:35 +0000 (22:57 -0600)
configure.ac

index 1edb4d8e9f939d7984f21a87c468287f5757b706..1c77692568d0e12cd6e04f3cdbc0aa0a81575eba 100644 (file)
@@ -1,4 +1,7 @@
-m4_define([jq_version], m4_esyscmd_s([git describe --tags --dirty --match 'jq-*'|sed 's/^jq-//']))
+m4_define([jq_version],
+          m4_esyscmd_s([(git rev-parse --verify -q jq-1.0 > /dev/null &&
+                        (git describe --tags --dirty --match 'jq-*'|sed 's/^jq-//')) ||
+                        echo `git rev-parse --abbrev-ref HEAD`-`git describe --always --dirty`])))
 
 AC_INIT([jq], [jq_version], [https://github.com/stedolan/jq/issues],
              [jq], [https://stedolan.github.io/jq])