--- /dev/null
+#!/bin/bash
+
+exec diff -u <(sed '/^Merging /s/ (.*$//' summ.old) <(sed '/^Merging /s/ (.*$//' summ)
--- /dev/null
+#!/bin/bash
+
+LOG_FILE="../merge.log"
+
+log()
+{
+ echo "$@" | tee -a $LOG_FILE
+}
+
+execute()
+{
+ log "$" $@
+ $@ 2>&1 | tee -a $LOG_FILE
+ return ${PIPESTATUS[0]}
+}
+
+GIT_EDITOR=: execute git rm -f "$@" || exit 1
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+log()
+{
+ echo "$@" | tee -a ../akpm-import.log
+}
+
+execute()
+{
+ log "$" $@
+ "$@" 2>&1 | tee -a ../akpm-import.log
+ [ ${PIPESTATUS[0]} -eq 0 ] || sh -i || {
+ [ -f "$sfile.orig" ] &&
+ mv -f "$sfile.orig" "$sfile"
+ exit 1
+ }
+}
+
+name="akpm"
+mmotm="../../mmotm/text"
+sfile="$mmotm/series"
+cpwd=$(pwd)
+
+base=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/origin.patch")
+nbase=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/linux-next.patch")
+log "Importing $name based on $base/$nbase"
+git rev-parse --verify "$base" >/dev/null || {
+ log "Unknown origin BASE"
+ exit 1
+}
+git rev-parse --verify "$nbase" >/dev/null || {
+ log "Unknown linux-next BASE"
+ exit 1
+}
+
+mv -f "$sfile" "$sfile.orig"
+do_echo=echo
+grep -q NEXT_PATCHES "$sfile.orig" && do_echo=:
+while read line; do
+ case $line in
+ *NEXT_PATCHES_START*) do_echo=echo
+ ;;
+ *NEXT_PATCHES_END*) do_echo=:
+ ;;
+ esac
+ $do_echo $line
+done <"$sfile.orig" |
+ sed -e 's/[ ]*#.*$//' -e '/^[ ]*$/d' >"$sfile"
+
+git show-ref --quiet --verify "refs/heads/quilt/$name" ||
+ execute git branch "quilt/$name" "$base"
+
+[ -s "$sfile" ] || {
+ log " quilt series is empty"
+ mv -f "$sfile.orig" "$sfile"
+ execute git update-ref "refs/heads/quilt/$name" "$nbase"
+ exit 0
+}
+
+[ -d "../quilt-tmp" ] ||
+ execute git clone -s -l -n -q . ../quilt-tmp
+
+log '$' cd ../quilt-tmp
+cd ../quilt-tmp
+execute git reset --hard "$base"
+GIT_EDITOR=: execute git merge "$nbase" || bash -i || exit 1
+git branch base
+
+for f in $(cat "$mmotm/series"); do
+ [ "$f" = "origin.patch" ] && continue
+ [ "$f" = "linux-next.patch" ] && continue
+ execute git am "$mmotm/broken-out/$f" ||
+ bash -i ||
+ break
+done
+
+log '$' cd $cpwd
+cd $cpwd
+
+execute git fetch -f ../quilt-tmp master:"quilt/$name"
+execute git fetch -f ../quilt-tmp base:"quilt/${name}-base"
+
+mv -f "$sfile.orig" "$sfile"
+
+[ -d "../quilt-tmp" ] &&
+ rm -rf ../quilt-tmp
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+LOG_FILE="../merge.log"
+build_host="ka2"
+build_dir="/scratch/sfr/next"
+build_cmd="bin/build_next"
+
+today="$(date '+%Y%m%d')"
+
+no_build=false
+[ "$NEXT_BUILD_HOST" ] && build_host="$NEXT_BUILD_HOST"
+[ "$NEXT_BUILD_DIR" ] && build_host="$NEXT_BUILD_DIR"
+
+[ "$1" = "-n" ] && {
+ shift
+ no_build=true
+}
+[ -n "$1" ] && {
+ build_host="$1"
+ shift
+}
+[ -n "$1" ] && {
+ build_dir="$1"
+ shift
+}
+
+log()
+{
+ echo "$@" | tee -a $LOG_FILE
+}
+
+execute()
+{
+ log "$" $@
+ $@ 2>&1 | tee -a $LOG_FILE
+ return ${PIPESTATUS[0]}
+}
+
+cpwd=../next
+
+execute git clone -s -l -n -q . ../rebase-tmp || {
+ echo Clone failed 1>&2
+ bash -i || exit
+}
+log '$' cd ../rebase-tmp
+cd ../rebase-tmp
+execute git fetch --no-tags $cpwd refs/heads/quilt/akpm:akpm || {
+ echo Fetch of top failed 1>&2
+ bash -i || exit
+}
+execute git fetch --no-tags $cpwd refs/heads/quilt/akpm-base:akpm-base || {
+ echo Fetch of base failed 1>&2
+ bash -i || exit
+}
+execute git checkout akpm || {
+ echo Checkout of top failed 1>&2
+ bash -i || exit
+}
+execute git rebase --onto master akpm-base || {
+ echo Rebase failed 1>&2
+ bash -i || exit
+}
+echo "fix up? use git rebase -i --onto master akpm-base"
+bash -i
+log '$' cd $cpwd
+cd $cpwd
+execute git fetch -f ../rebase-tmp akpm:akpm || {
+ echo Pull failed 1>&2
+ bash -i || exit
+}
+execute rm -rf ../rebase-tmp
+
+git update-ref "refs/next/$today/akpm" akpm
+git update-ref refs/heads/akpm-end HEAD
+git update-ref refs/heads/quilt/akpm refs/heads/akpm
+git update-ref refs/heads/quilt/akpm-base refs/heads/akpm-end
+
+log Merging akpm '('$(git log -1 --oneline akpm)')'
+execute git merge --no-ff akpm || {
+ echo Merge failed 1>&2
+ bash -i || exit
+}
+
+[ -f "../merge-fixes/akpm" ] && {
+ for p in $(cat "../merge-fixes/akpm"); do
+ ../tools/merge_fix -n "$p" || {
+ bash -i || exit
+ }
+ done
+}
+[ -x "../pre-build/akpm" ] && {
+ "../pre-build/akpm" || bash -i || exit
+}
+
+$no_build && exit 0
+
+git push -f "$build_host":"$build_dir" master:refs/heads/next || {
+ echo git push failed 1>&2
+ bash -i || exit
+}
+ssh "$build_host" "$build_cmd" || {
+ echo Build failed 1>&2
+ bash -i || exit
+}
+
+exit 0
+
--- /dev/null
+#!/bin/bash
+
+ssh ozlabs.org "cd kernels/linus.git; git remote update"
+
+cd ~/kernels/next/next
+git push bilbo
+ssh ozlabs.org "cd kernels/next/next; git reset --hard"
+
+cd ~/kernels/next/next-history.git
+git push bilbo
+
+cd ~/kernels/next/quilt
+git push bilbo
+ssh ozlabs.org "cd kernels/next/quilt; git reset --hard"
+
+cd ../../
+rsync -avHP --exclude gitk.cache --exclude next-2'*'/ --exclude next/'**' --exclude quilt/'**' --include next-fixes/.git --include next-fixes/.git/'**' --exclude next-fixes/'**' --exclude next-history.git/'**' --delete next/ ozlabs.org:kernels/next/
+
+ssh ozlabs.org "touch kernels/NEXT-DONE"
+
+exit 0