8 if expr "$oldrev" : '0*$' >/dev/null ; then
12 git rev-parse --not --branches | git rev-list --stdin $oldrev..$newrev | while read commit ; do
13 number_of_parents=$(git rev-list -n 1 --parents $commit | sed 's/ /\n/g' | grep -v $commit | wc -l)
14 if [[ $number_of_parents > 1 ]] ; then
15 # Find the original branch point (B)
16 parents=$(git rev-list -n 1 --parents $commit | sed 's/ /\n/g' | grep -v $commit)
17 baserev=$(git merge-base $parents)
20 git rev-list -n 1 --parents $commit | sed 's/ /\n/g' | grep -v $commit | while read parent ; do
21 all_commits=$(git rev-list $baserev..$parent | wc -l)
22 new_commits=$(git rev-parse --not --branches | git rev-list --stdin $baserev..$parent | wc -l)
23 if [[ $all_commits -eq $new_commits ]] ; then
24 echo "----------------------------------------------------"
26 echo "It looks like you should rebase instead of merging $commit"
28 echo "----------------------------------------------------"
32 if [ $? -ne 0 ] ; then