13 [ -z "$start_from" ] && {
14 echo "-s requires a start tree" 1>&2
20 tool_dir=$(dirname "$0")
21 . "$tool_dir/common.sh"
25 echo "$@" | tee -a "$LOG_FILE"
31 "$@" 2>&1 | tee -a "$LOG_FILE"
32 return "${PIPESTATUS[0]}"
35 [ -n "$start_from" ] || {
36 cp /dev/null "$LOG_FILE"
38 execute git checkout master
39 execute git reset --hard stable
40 printf 'Name\t\tSHA1\n----\t\t----\n' > "$SHA1_FILE"
44 heads=$(awk -F '\t' '/^#/ { next; } $2=="quilt" || $2=="git" { printf("%s/%s ", $3, $5); } $2=="branch" { printf("branch/%s ", $1); }' "$CTRL_FILE")
51 [ -n "$start_from" ] && {
52 if [ "$tree" = "$start_from" ]; then
59 [ "$tree" = "branch" ] && {
60 git branch -f "${h#branch/}"
64 hlog=$(git log -1 --oneline "${h/\/*://}") 2>/dev/null
65 old_head=$(git rev-parse HEAD)
66 [ -f "../pre-merge/$tree" ] && {
67 for p in $(cat "../pre-merge/$tree"); do
68 "$bin_dir/do_patch" -n "$p" || {
69 linux-next-notify "premerge patch failed"
74 log Merging "$h" "($hlog)"
75 execute git merge "$h" || {
76 echo Merge failed 1>&2
77 echo "$h" >>../merge.debug
78 git diff >>../merge.debug 2>&1
80 check_unmerged_files "$tree"
82 git diff 2>&1 | egrep -q '<<<<<|^\*' && {
83 linux-next-notify "new conflict found merging $tree"
84 if [ -f "../merge-fixes/$tree" ]; then
85 echo "Merge fixes exist for this tree:"
86 cat "../merge-fixes/$tree"
90 # [ "$(git status --porcelain)" ] && {
91 GIT_EDITOR=: execute git commit -v -a || {
92 linux-next-notify "next commit failed for $tree"
95 execute git diff -M --stat --summary 'HEAD^..'
98 [ -f "../merge-fixes/$tree" ] && {
99 for p in $(cat "../merge-fixes/$tree"); do
100 "$bin_dir/merge_fix" -n "$p" || {
101 linux-next-notify "merge fix failed for $tree"
107 [ $(echo "$tree" | wc -c) -le 8 ] && tab="\t\t"
108 printf "%s$tab%s\n" $tree $(git rev-parse "${h/\/*://}^{}") >> $SHA1_FILE
109 $no_build && continue
111 # See if we need to build after merging this tree
112 new_head=$(git rev-parse HEAD)
113 [ "$old_head" = "$new_head" ] ||
114 [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] ||
119 do_build=$(awk -F '\t' '/^[^#]/ && $3=="'$tree'" { print $6; }' "$CTRL_FILE")
120 [ "$do_build" = "yes" ] ||
122 git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || {
123 echo git push failed 1>&2
124 linux-next-notify "push failed for $tree"
127 [ -x "../pre-build/$tree" ] && {
128 "../pre-build/$tree" || {
129 echo Prebuild script failed 1>&2
130 linux-next-notify "pre-build script failed for $tree"
134 "$bin_dir/do_build" "$tree" || {
135 echo Build failed 1>&2
136 linux-next-notify "build failed for $tree"