Prior to this patch we were only pushing 'master' and 'ansible-1.9'
branches. Each new release also introduces a new branch so we want to
push it as well.
Yes the 'grep' is a bit ugly, feel free to come up with something nicer :)
Signed-off-by: Sébastien Han <seb@redhat.com>
reset_hard_origin
# First we filter branches by rewriting master with the content of roles/$ROLE
# this gives us a new commit history
- for BRANCH in $BRANCHES; do
+ for BRANCH in $(git branch -r | egrep 'origin/master|origin/ansible-1.9|origin/stable-' | grep -v origin/HEAD | cut -d '/' -f2); do
git checkout -B $BRANCH origin/$BRANCH
git filter-branch -f --prune-empty --subdirectory-filter roles/$ROLE
git push -f $REMOTE $BRANCH