private Make tweaks for more separate installations.
[git.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         rebase= done= not_done= trouble= date=
13         topic_sha1=`git rev-parse --verify "refs/heads/$topic"`
14
15         date=`
16                 git-rev-list -1 --pretty "$topic" |
17                 sed -ne 's/^Date: *\(.*\)/ (\1)/p'
18         `
19         only_next_1=`git-rev-list ^master "^$topic" next | sort`
20         only_next_2=`git-rev-list ^master           next | sort`
21         rebase=
22         if test "$only_next_1" = "$only_next_2"
23         then
24                 not_in_topic=`git-rev-list "^$topic" master`
25                 if test -z "$not_in_topic"
26                 then
27                         :; # already up-to-date.
28                 else
29                         rebase=" (can be rebased)"
30                 fi
31         fi
32         if test -n "$rebase"
33         then
34                 echo "Rebasing $topic to pick up:"
35                 git-rev-list --pretty=oneline "^$topic" master |
36                 sed -e 's/^[0-9a-f]* / * /'
37                 git checkout "$topic" &&
38                 git rebase master || break;
39         fi
40 done
41
42