3 git rev-list --first-parent "origin/stable..HEAD" | while read commit ; do
4 number_of_parents=$(git rev-list -n 1 --parents $commit | sed 's/ /\n/g' | grep -v $commit | wc -l)
5 if [[ $number_of_parents > 1 ]] ; then
7 git rev-list --no-walk --parents $commit | sed 's/ /\n/g' | grep -v $commit | while read parent ; do
8 echo "merge=$commit parent=$parent"
9 # Does this parent have any children besides us?
11 # List the parents of all branch commits (after stable/parent), find
12 # those that include our parent, get their sha1, remove our merge
13 git rev-list --parents --branches ^stable "^$parent" | grep $parent | gawk '{print $1}' | grep -v $commit | while read child ; do
15 git rev-list "$child" "^$commit"
17 # Find any commits in the parent (and another branch) but not us--that means we need it
18 # number_missing=$(git rev-list "$parent" --branches "^HEAD" | wc -l)
19 # if [[ $number_missing > 0 ]] ; then
20 # git rev-list "$parent" --branches "^HEAD" | xargs git name-rev