Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Gimp/.gitlab/   (Gimp Bildeditor Version 3.2.0©)  Datei vom 14.2.2026 mit Größe 1 kB image not shown  

Quelle  check_dead_branches.sh   Sprache: Shell

 

#!/bin/sh

printf "\e[0Ksection_start:`date +%s`:branch_check[collapsed=false]\r\e[0KChecking for dead branches\n"
git branch -r | grep -v 'origin/HEAD' | grep -v "origin/$CI_DEFAULT_BRANCH" | while IFS= read remote_branch; do
  remote_branch=$(printf "%s\n" "$remote_branch" | sed 's/^ *//;s/ *$//')
  branch_name=$(printf "%s\n" "$remote_branch" | sed 's|origin/||')
  
  # NOT CHECKING
  ## Skip old stable branches
  if echo "$branch_name" | grep -q "^gimp-[0-9]-" || [ "$branch_name" = "gnome-2-2" ] || [ "$branch_name" = "gnome-2-4" ]; then
    printf "\033[33m(SKIP)\033[0m: $branch_name is a snapshot of $CI_DEFAULT_BRANCH but no problem\n"
    continue
  fi
  ## Skip recently created branches
  if [ "$(git rev-parse "$remote_branch")" = "$(git rev-parse "$CI_COMMIT_SHA")" ]; then
    printf "\033[33m(SKIP)\033[0m: $branch_name is identical to $CI_DEFAULT_BRANCH but no problem\n"
    continue
  fi

  # CHECKING
  ## Check: merge-base
  if git merge-base --is-ancestor "$remote_branch" "$CI_COMMIT_SHA"; then
    printf "\033[31m(ERROR)\033[0m: $branch_name is fully merged into $CI_DEFAULT_BRANCH (via git merge-base)\n"
    touch 'dead_branch'
    continue
  fi
  ## Fallback check: cherry
  cherry_output=$(git cherry "$CI_COMMIT_SHA" "$remote_branch")
  if [ -z "$(printf "%s\n" "$cherry_output" | grep '^+')" ]; then
    printf "\033[31m(ERROR)\033[0m: $branch_name is fully merged into $CI_DEFAULT_BRANCH (via git cherry)\n"
    touch 'dead_branch'
    continue
  fi
done

if [ -f "dead_branch" ]; then
  printf "         Please delete the merged branches\n"
  exit 1
else
  printf '(INFO): All branches are organized.\n'
fi
printf "\e[0Ksection_end:`date +%s`:branch_check\r\e[0K\n"

Messung
CHZG
93958189

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-03) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.