From 27b63678181c7aa570de2e917baab7181f4bf638 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 9 Mar 2018 14:47:07 +0100 Subject: [PATCH 1/2] misc: add confirmation to archive-branches script License: MIT Signed-off-by: Jakub Sztandera --- bin/archive-branches.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/archive-branches.sh b/bin/archive-branches.sh index b2cca5d3713..ab107b405a6 100755 --- a/bin/archive-branches.sh +++ b/bin/archive-branches.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' -set -x auth="" #auth="-u kubuxu:$GH_TOKEN" @@ -48,9 +47,23 @@ active_branches() { git remote add archived "git@github.com:$org/$arch_repo.git" || true -cat <(active_branches) <(pr_branches) <((IFS=$'\n'; echo "${exclusions[*]}")) \ - | sort -u | comm - <(origin_refs | sort) -13 |\ - while read -r ref; do +branches_to_move="$(cat <(active_branches) <(pr_branches) <((IFS=$'\n'; echo "${exclusions[*]}")) | sort -u | comm - <(origin_refs | sort) -13)" + +echo "================" +printf "%s\n" "$branches_to_move" +echo "================" + +echo "Please confirm move of above branches [y/N]:" + +read line +case $line in + [Yy]|[Yy][Ee][Ss]) ;; + *) exit 1 ;; +esac + + +printf "%s\n" "$branches_to_move" | \ +while read -r ref; do git push archived "origin/$ref:refs/heads/$ref/$(date --rfc-3339=date)" git push origin --delete "$ref" done From 8b66077e2ab7bddd1599cc1be2c0acccbb8b3f16 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 9 Mar 2018 14:52:00 +0100 Subject: [PATCH 2/2] misc: add ai-mirror to excluded branches License: MIT Signed-off-by: Jakub Sztandera --- bin/archive-branches.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/archive-branches.sh b/bin/archive-branches.sh index ab107b405a6..50fcb3ccc65 100755 --- a/bin/archive-branches.sh +++ b/bin/archive-branches.sh @@ -13,6 +13,7 @@ exclusions=( 'master' 'release' 'feat/zcash' + 'feat/ai-mirror' ) gh_api_next() {