11 echo "patch does not exist" 1>&2
15 . "$(dirname $0)/common.sh"
19 echo "$@" | tee -a $LOG_FILE
25 $@ 2>&1 | tee -a $LOG_FILE
26 return ${PIPESTATUS[0]}
29 old_head=$(git rev-parse HEAD)
30 execute git am -3 "$patch" || {
31 echo "git am failed" 1>&2
34 new_head=$(git rev-parse HEAD)
35 [ "$old_head" = "$new_head" ] && {
36 echo "hmmm, looks like the patch was already applied or is unneeded"
39 [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] && {
40 echo "hmmm, committed soemthing, but diff is empty" 1>&2
44 GIT_EDITOR=: execute git reset 'HEAD^' || {
45 echo "git reset failed" 1>&2
48 execute git add -A . || {
49 echo "git add failed" 1>&2
52 GIT_EDITOR=: execute git commit -v -a --amend || {
53 echo "git commit failed" 1>&2
59 git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || {
60 echo git push failed 1>&2
64 "$bin_dir/do_build" || {
65 echo Build failed 1>&2