Make: fix test installation.
[git] / RB
1 #!/bin/sh
2
3 master_sha1=`git rev-parse --verify refs/heads/master`
4 LF='
5 '
6 (cd .git/refs/heads && find -type f) |
7 sed -n \
8     -e 's/^\.\///' \
9     -e '/^[^\/][^\/]\//p' |
10 while read topic
11 do
12         case " $* " in
13         *' '"$topic"' '*)
14                 echo >&2 "* Skipping $topic"
15                 continue ;;
16         esac
17
18         rebase= done= not_done= trouble= date=
19         topic_sha1=`git rev-parse --verify "refs/heads/$topic"`
20
21         date=`
22                 git rev-list -1 --pretty "$topic" |
23                 sed -ne 's/^Date: *\(.*\)/ (\1)/p'
24         `
25         only_next_1=`git rev-list ^master "^$topic" next | sort`
26         only_next_2=`git rev-list ^master           next | sort`
27         rebase=
28         if test "$only_next_1" = "$only_next_2"
29         then
30                 not_in_topic=`git rev-list "^$topic" master`
31                 if test -z "$not_in_topic"
32                 then
33                         :; # already up-to-date.
34                 else
35                         rebase=" (can be rebased)"
36                 fi
37         fi
38         if test -n "$rebase"
39         then
40                 echo "Rebasing $topic to pick up:"
41                 git rev-list --pretty=oneline "^$topic" master |
42                 sed -e 's/^[0-9a-f]* / * /'
43                 git checkout "$topic" &&
44                 git rebase master || break;
45         fi
46 done
47
48