blob: 1395c92c3d780d5443f8627330bb0b1133968f44 (
plain) (
tree)
|
|
#!/usr/bin/env bash
#
# Usage: get-scala-commit-drift [dir]
# Figures out current commit drift of a git clone.
# If no dir is given, current working dir is used.
#
# Example output string:
# 123
#
# Build drift = # of commits since last tag.
[[ $# -eq 0 ]] || cd "$1"
# 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"
|