summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2011-12-05 15:02:57 -0500
committerJosh Suereth <joshua.suereth@gmail.com>2011-12-05 15:02:57 -0500
commit01fffafac5f8184fc6abc4268a2b2d1a2503d5ca (patch)
tree392182d9addf0311e1c4961eee4fb38b4185d4c0 /tools
parentc86928f1dc736605a182e20528192eaed91bea62 (diff)
parent09ba583b1e08b96d9b1d703a1c0c6bdaa55ae7f7 (diff)
downloadscala-01fffafac5f8184fc6abc4268a2b2d1a2503d5ca.tar.gz
scala-01fffafac5f8184fc6abc4268a2b2d1a2503d5ca.tar.bz2
scala-01fffafac5f8184fc6abc4268a2b2d1a2503d5ca.zip
Merge branch 'master' into xsbt
Diffstat (limited to 'tools')
-rwxr-xr-xtools/get-scala-revision11
-rw-r--r--tools/get-scala-revision.bat3
2 files changed, 10 insertions, 4 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
diff --git a/tools/get-scala-revision.bat b/tools/get-scala-revision.bat
index ed3ade8a3e..f4dc24b71f 100644
--- a/tools/get-scala-revision.bat
+++ b/tools/get-scala-revision.bat
@@ -15,8 +15,7 @@ if "%*"=="" (
cd %_DIR%
if exist .git\NUL (
- git describe head --abbrev=7 --match dev
- echo 0
+ git describe HEAD --abbrev=7 --match dev
)
:end