]> juplo.de Git - demos/kafka/training/commitdiff
fix(push.sh): Backup-Tags nur anlegen, wenn mind. ein Remote-Stand ungetagged ist
authorKai Moritz <kai.milan.moritz@googlemail.com>
Fri, 12 Jun 2026 16:59:52 +0000 (16:59 +0000)
committerKai Moritz <kai.milan.moritz@googlemail.com>
Fri, 12 Jun 2026 16:59:52 +0000 (16:59 +0000)
Bisher wurde nur geprüft, ob Branches überschrieben werden (kein Fast-Forward)
und dabei ungetagged sind. Jetzt gilt: sind alle Remote-Stände bereits remote
getagged (einheitlich oder nicht), werden keine TIMESTAMP-Backup-Tags angelegt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
push.sh

diff --git a/push.sh b/push.sh
index 9ef0a5bf340ba2fa60b25865fbedfa70a6305937..ad4233773bfc345329b1b37b615e8f4212baefb5 100755 (executable)
--- a/push.sh
+++ b/push.sh
@@ -35,14 +35,10 @@ remote_has_tag() {
   echo "$remote_tags" | awk '{print $1}' | grep -qxF "$1"
 }
 
-# Step 1: Check if any branch would be rewritten (not just extended) and has no remote tag
+# Step 1: Check if any remote branch state has no tag in the remote repository
 need_timestamp_backup=false
 for branch in "${BRANCH_NAMES[@]}"; do
   remote_commit=$(git rev-parse "refs/remotes/origin/$branch" 2>/dev/null) || continue
-  git rev-parse --verify "$branch" &>/dev/null || continue
-  # Skip if remote would only be extended (fast-forward)
-  git merge-base --is-ancestor "origin/$branch" "$branch" 2>/dev/null && continue
-  # Remote would be rewritten — check if it has any tag in the remote repository
   if ! remote_has_tag "$remote_commit"; then
     need_timestamp_backup=true
     break