#!/bin/sh -e

### rebase -- Rebase topic branches

# BSD Owl Scripts (https://github.com/michipili/bsdowl)
# This file is part of BSD Owl Scripts
#
# Copyright © 2015 Michael Grünewald. All Rights Reserved.
#
# This file must be used under the terms of the BSD license.
# This source file is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.

topic_branch_list()
{
    git branch | sed -n -e 's/^..//;/^topic/p'
}


topic_branch_rebase()
{
    local branch

    while read "branch"; do
        git rebase --onto master master "${branch}"
    done
}

topic_branch_list | topic_branch_rebase

### End of file `rebase'
