summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2015-02-24 19:17:20 +0000
committerTails developers <amnesia@boum.org>2015-02-24 19:27:15 +0000
commit527a743dc13e9d852317e6f077ab030996963be2 (patch)
tree98080836b01bf50d2a1c32fcedf5cc9c200b0d3e /bin
parent27845603e5cb788e8298661d60efa6c88690d53c (diff)
Delete up to 30 branches at a time on the remote.
Let's don't overload post-push triggers, and let's not depend so much on network latency.
Diffstat (limited to 'bin')
-rw-r--r--bin/git-delete-branches.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/git-delete-branches.sh b/bin/git-delete-branches.sh
index fdecbf6..aa0ffd0 100644
--- a/bin/git-delete-branches.sh
+++ b/bin/git-delete-branches.sh
@@ -56,15 +56,17 @@ else
read answer
case $answer in
y|Y|Yes|yes)
+ REFS=''
for BRANCH in $REMOTE_BR; do
echo -n "Remove branch '$BRANCH'? (Y/n): "
read answer
case "$answer" in
''|y|Y|Yes|yes)
- git push $(echo $BRANCH | sed 's/^\([^/]\+\)\/\(.\+\)/\1 :\2/')
+ REFS="$REFS $(echo $BRANCH | sed 's/^[^/]\+\/\(.\+\)/:\1/')"
;;
esac
done
+ echo "$REFS" | xargs -n30 git push "$MANAGED_REMOTE"
if [ -n "$LOCAL_BR" ]; then
git branch --merged | grep -Ev "^\s+($(generate "$BRANCHES_TO_KEEP"))$" | xargs -n30 git branch -d
fi