3 log_file=../akpm-import.log
7 echo "$@" | tee -a $log_file
13 "$@" 2>&1 | tee -a $log_file
14 [ ${PIPESTATUS[0]} -eq 0 ] || $SHELL -i || exit 1
21 [ -f "$mmotm/broken-out/origin.patch" ] &&
22 base=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/origin.patch")
24 base=$(tail -n 1 "$mmotm/.DATE")
28 nbase=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/linux-next.patch")
29 git rev-parse --verify "$base" >/dev/null || {
30 log "Unknown origin BASE $base"
33 git rev-parse --verify "$nbase" >/dev/null || {
34 log "Unknown linux-next BASE $nbase"
37 db=$(git describe "$base")
38 dnb=$(git describe --contains "$nbase")
39 log "Importing akpm based on $db/$dnb"
41 [ -d "../tmp-akpm" ] && {
42 log "akpm import directory already exists"
46 execute git worktree add -b tmp-akpm/master ../tmp-akpm "$db"
48 log '$' cd ../tmp-akpm
50 execute git branch tmp-akpm/current-base
53 /NEXT_PATCHES_START/,/NEXT_PATCHES_END/{
58 patches=$(sed -n "$sed_exp" "$sfile")
65 execute git branch tmp-akpm/current
66 execute git merge --no-edit --no-stat "$dnb"
67 execute git branch tmp-akpm/master-base
70 execute git am -s --patch-format=mbox "$mmotm/broken-out/$f"
78 execute rm -rf ../tmp-akpm
79 execute git worktree prune
81 for i in akpm/current akpm/current-base akpm/master akpm/master-base; do
82 execute git branch -f $i tmp-$i
83 execute git branch -D tmp-$i