]>
git.proxmox.com Git - debcargo-conf.git/blob - dev/sync-pending-branches.sh
2 # Sync remote pending branches locally, and prune merged branches.
6 git rev-parse
-q --verify "$@" || true
9 git fetch origin
--prune
10 PREVBRANCH
="$(git rev-parse --abbrev-ref HEAD)"
13 git branch
--merged |
tr -d ' ' |
grep ^pending- |
xargs -trn1 git branch
-d
14 merged
=( $
(git branch
--list -r 'origin/pending-*' --format='%(refname:lstrip=3)' --merged) )
15 git push origin
"${merged[@]/#/:}"
18 git branch
--list -r 'origin/pending-*' --format='%(refname:lstrip=3)' |
while read b
; do
19 if [ -z "$(git_hash "$b")" ]; then
23 git checkout
"$PREVBRANCH"
24 git branch
--list 'pending-*' --format='%(refname:lstrip=2)' |
while read b
; do
25 if [ "$(git_hash "$b")" != "$(git_hash "origin
/$b")" ]; then
26 echo >&2 "WARNING: Local $b ($(git_hash "$b")) differs from remote $b ($(git_hash "origin
/$b"))"