summaryrefslogtreecommitdiff
path: root/tools/get-scala-revision
diff options
context:
space:
mode:
authorAleksandar Prokopec <aleksandar.prokopec@gmail.com>2011-12-07 14:53:37 +0100
committerAleksandar Prokopec <aleksandar.prokopec@gmail.com>2011-12-07 14:53:37 +0100
commit014a13d2be634bb3ab3468d0c071a9a870a9a9b0 (patch)
tree491ad18ca796a70b34be1d4732b80c371bfd650d /tools/get-scala-revision
parenta36175feb5bfce59909fa4f3d9d5df6753b6ee3a (diff)
parent332fec96e31840878bed41dd7b5314b97d8da7c2 (diff)
downloadscala-014a13d2be634bb3ab3468d0c071a9a870a9a9b0.tar.gz
scala-014a13d2be634bb3ab3468d0c071a9a870a9a9b0.tar.bz2
scala-014a13d2be634bb3ab3468d0c071a9a870a9a9b0.zip
Merge branch 'master' of https://github.com/scala/scala into execution-context
Diffstat (limited to 'tools/get-scala-revision')
-rwxr-xr-xtools/get-scala-revision11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/get-scala-revision b/tools/get-scala-revision
index 23b216aa2b..e8597844cc 100755
--- a/tools/get-scala-revision
+++ b/tools/get-scala-revision
@@ -5,8 +5,15 @@
#
# If no dir is given, current working dir is used.
-[[ -n "$1" ]] && cd "$1"
+[ -n "$1" ] && cd "$1"
# dev should be a tag at the merge-base of master and the
# most recent release.
-git describe head --abbrev=7 --match dev
+if [ -z $(git tag -l dev) ]; then
+ # no dev tag available - this will generate dev-g<sha>
+ echo "dev-g$(git describe HEAD --abbrev=7 --always)"
+else
+ # dev tag exists - this generates dev-NNNN-g<sha>
+ # where NNNN is the number of commits since dev.
+ git describe HEAD --abbrev=7 --match dev
+fi