diff options
Diffstat (limited to 'tools/get-scala-commit-drift')
-rwxr-xr-x | tools/get-scala-commit-drift | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/tools/get-scala-commit-drift b/tools/get-scala-commit-drift index 4959826ec1..1395c92c3d 100755 --- a/tools/get-scala-commit-drift +++ b/tools/get-scala-commit-drift @@ -11,30 +11,7 @@ [[ $# -eq 0 ]] || cd "$1" -ensure_tag () { - sha=$1 - rev=$2 - - [[ -n $(git tag -l $rev) ]] || { - git tag -a -m "generated by get-scala-revision" $rev $sha - } -} - -# Ensure some baseline tags are present so if this repository's -# tags are screwed up or stale, we should still have a reference -# point for a build string. -ensure_tag 58cb15c40d v2.10.0-M1 -ensure_tag 29f3eace1e v2.9.1 -ensure_tag b0d78f6b9c v2.8.2 - -# the closest tag, obtained separately because we have to -# reconstruct the string around the padded distance. -tag=$(git describe --tags --match 'v2*' --abbrev=0) - -# printf %016s is not portable for 0-padding, has to be a digit. -# so we're stuck disassembling it. -described=$(git describe --tags --match 'v2*' --abbrev=10) -suffix="${described##${tag}-}" -counter=$(echo $suffix | cut -d - -f 1) - -echo "$counter" +# git describe is completely useles to us if we're on a tag, or haven't changed since then. +# This at least gives us a total number of commits included in a release, which should grow steadily. +counter=$(git shortlog | grep -E '^[ ]+\w+' | wc -l) +printf "%08d" "$counter" |