3 LOG_FILE="../merge.log"
5 build_dir="/scratch/sfr/next"
6 build_cmd="bin/build_next"
8 today="$(date '+%Y%m%d')"
11 [ "$NEXT_BUILD_HOST" ] && build_host="$NEXT_BUILD_HOST"
12 [ "$NEXT_BUILD_DIR" ] && build_host="$NEXT_BUILD_DIR"
29 echo "$@" | tee -a $LOG_FILE
35 $@ 2>&1 | tee -a $LOG_FILE
36 return ${PIPESTATUS[0]}
41 execute git clone -s -l -n -q . ../rebase-tmp || {
42 echo Clone failed 1>&2
45 log '$' cd ../rebase-tmp
47 execute git fetch --no-tags $cpwd refs/heads/quilt/akpm:akpm || {
48 echo Fetch of top failed 1>&2
51 execute git fetch --no-tags $cpwd refs/heads/quilt/akpm-base:akpm-base || {
52 echo Fetch of base failed 1>&2
55 execute git checkout akpm || {
56 echo Checkout of top failed 1>&2
59 execute git rebase --onto master akpm-base || {
60 echo Rebase failed 1>&2
63 echo "fix up? use git rebase -i --onto master akpm-base"
67 execute git fetch -f ../rebase-tmp akpm:akpm || {
71 execute rm -rf ../rebase-tmp
73 git update-ref "refs/next/$today/akpm" akpm
74 git update-ref refs/heads/akpm-end HEAD
75 git update-ref refs/heads/quilt/akpm refs/heads/akpm
76 git update-ref refs/heads/quilt/akpm-base refs/heads/akpm-end
78 log Merging akpm '('$(git log -1 --oneline akpm)')'
79 execute git merge --no-ff akpm || {
80 echo Merge failed 1>&2
84 [ -f "../merge-fixes/akpm" ] && {
85 for p in $(cat "../merge-fixes/akpm"); do
86 ../tools/merge_fix -n "$p" || {
91 [ -x "../pre-build/akpm" ] && {
92 "../pre-build/akpm" || bash -i || exit
97 git push -f "$build_host":"$build_dir" master:refs/heads/next || {
98 echo git push failed 1>&2
101 ssh "$build_host" "$build_cmd" || {
102 echo Build failed 1>&2