Skip to content
Myr

Fix version scripts for some shallow clone situations (fix #1549) (#2608)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by itchyny · committed by GitHub · parent 5cebe86 · Browse files · 2 files+9 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+9 added−11 removed

  • other:+9 added−11 removed

2 files+9 added−11 removed

modified:scripts/version+8 added-7 removed
1#!/bin/sh2set -e3cd `dirname "$0"`4if git rev-parse --verify -q jq-1.0 > /dev/null 2>&1; then5 git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'2set -eu34cd "$(dirname "$0")"5if git describe --tags --match 'jq-*' >/dev/null 2>&1; then6 git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'7else7 b=`git rev-parse --abbrev-ref HEAD`8 c=`git describe --always --dirty`9 echo "${b}-${c}"8 branch=$(git rev-parse --abbrev-ref HEAD)9 commit=$(git describe --always --dirty)10 echo "${branch}-${commit}"11fi
modified:configure.ac+1 added-4 removed
1m4_define([jq_version],2 m4_esyscmd_s([(git rev-parse --verify -q jq-1.0 > /dev/null &&3 (git describe --tags --dirty --match 'jq-*'|sed 's/^jq-//')) ||4 echo `git rev-parse --abbrev-ref HEAD`-`git describe --always --dirty`])))1m4_define([jq_version], m4_esyscmd_s([scripts/version])))23AC_INIT([jq], [jq_version], [https://github.com/jqlang/jq/issues],4 [jq], [https://jqlang.github.io/jq])5
291 unmodified lines