This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to tag tags/v3/01-01-starter-app
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git

commit 90108198dd39ee251f5222a69b03329e41e5cb59
Author: Dan Haywood <[email protected]>
AuthorDate: Thu May 30 21:22:26 2024 +0100

    recreate-v3-tags.sh completed
    
    and other chmod +x
---
 recreate-v3-tags.sh         | 86 +++++++++++++++++++++++++++++++++++++++++++--
 serve-timeline.sh           |  0
 update-to-latest-nightly.sh |  0
 3 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/recreate-v3-tags.sh b/recreate-v3-tags.sh
index 140a3f5..eac573d 100755
--- a/recreate-v3-tags.sh
+++ b/recreate-v3-tags.sh
@@ -1,4 +1,86 @@
-for tag in $(git tags | grep v2)
+#!/usr/bin/env bash
+usage() {
+  echo "$(basename $0): [-x] -P" >&2
+  echo "  -x : execute; otherwise acts as a dry-run" >&2
+  echo "  -P : skip push; otherwise will push all changes to origin" >&2
+  echo "" >&2
+}
+
+EXECUTE="no"
+PUSH="yes"
+
+while getopts ":hPx" arg; do
+  case $arg in
+    h)
+      usage
+      exit 0
+      ;;
+    x)
+      EXECUTE="yes"
+      ;;
+    P)
+      PUSH="no"
+      ;;
+    *)
+      usage
+      exit 1
+  esac
+done
+
+shift $((OPTIND-1))
+
+echo "-x : EXECUTE : ${EXECUTE}"
+echo "-P : PUSH    : ${PUSH}"
+
+for TAGV3 in $(git tag | grep v3)
+do
+
+  echo git tag -d $TAGV3
+  if [ "$EXECUTE" = "yes" ]
+  then
+    git tag -d $TAGV3
+  fi
+
+  if [ "$PUSH" = "yes" ]
+  then
+    echo git push origin $TAGV3 --delete
+    if [ "$EXECUTE" = "yes" ]
+    then
+      git push origin $TAGV3 --delete
+    fi
+  fi
+
+done
+
+
+PREV=
+for TAGV2 in $(git tag | grep v2)
 do
-       echo $tag
+  TAGV3=$(echo $TAGV2 | sed s/v2/v3/)
+
+  if [ -n "$PREV" ]
+  then
+    echo git cherry-pick $PREV..$TAGV2
+    if [ "$EXECUTE" = "yes" ]
+    then
+      git cherry-pick $PREV..$TAGV2
+    fi
+  fi
+
+  echo git merge $TAGV2 --no-edit
+  if [ "$EXECUTE" = "yes" ]
+  then
+    git merge $TAGV2 --no-edit
+  fi
+
+  echo git tag $TAGV3
+  if [ "$EXECUTE" = "yes" ]
+  then
+    git tag $TAGV3
+  fi
+
+  PREV=$TAGV2
+
+  read -p "continue?"
 done
+
diff --git a/serve-timeline.sh b/serve-timeline.sh
old mode 100644
new mode 100755
diff --git a/update-to-latest-nightly.sh b/update-to-latest-nightly.sh
old mode 100644
new mode 100755

Reply via email to