Merge branch '17305-projects-file-size-always-0'
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Mon, 7 Jun 2021 20:43:59 +0000 (22:43 +0200)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Mon, 7 Jun 2021 20:44:02 +0000 (22:44 +0200)
closes #17305

Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

version-at-commit.sh

index 84d7d0b4ae3faa0f96f0291c0202616b6c1a0534..fc60d53e0f20870b355aacd359ec3e3b99ed6a21 100755 (executable)
@@ -6,7 +6,7 @@
 set -e -o pipefail
 commit="$1"
 versionglob="[0-9].[0-9]*.[0-9]*"
-devsuffix=".dev"
+devsuffix="~dev"
 
 # automatically assign version
 #
@@ -37,13 +37,12 @@ else
     merge_base=$(git merge-base origin/master "$commit")
 
     if git merge-base --is-ancestor "$nearest_tag" "$merge_base" ; then
-        # x.(y+1).0.devTIMESTAMP, where x.y.z is the newest version that does not contain $commit
-        # grep reads the list of tags (-f) that contain $commit and filters them out (-v)
-        # this prevents a newer tag from retroactively changing the versions of everything before it
-        # We also filter out four-digit faux semantic versioning tags, they gum up the works.
-        v=$(git tag | grep -vFf <(git tag --contains "$commit") |grep -v -P '\d.\d.\d.\d' | sort -Vr | head -n1 | perl -pe 's/\.(\d+)\.\d+/".".($1+1).".0"/e')
+        # x.(y+1).0~devTIMESTAMP, where x.y.z is the newest version that does not contain $commit
+       # grep reads the list of tags (-f) that contain $commit and filters them out (-v)
+       # this prevents a newer tag from retroactively changing the versions of everything before it
+        v=$(git tag | grep -vFf <(git tag --contains "$commit") | sort -Vr | head -n1 | perl -pe 's/(\d+)\.(\d+)\.\d+.*/"$1.".($2+1).".0"/e')
     else
-        # x.y.(z+1).devTIMESTAMP, where x.y.z is the latest released ancestor of $commit
+        # x.y.(z+1)~devTIMESTAMP, where x.y.z is the latest released ancestor of $commit
         v=$(echo $nearest_tag | perl -pe 's/(\d+)$/$1+1/e')
     fi
     isodate=$(TZ=UTC git log -n1 --format=%cd --date=iso "$commit")