]> git.ozlabs.org Git - next-scripts/commitdiff
allow for restarting the merge from not the first tree
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 20 Jan 2009 00:12:57 +0000 (11:12 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 20 Jan 2009 00:12:57 +0000 (11:12 +1100)
do_merge

index ff19ef6f17be0386c1b6f2c586bb553175b0d96f..d1648123d08ad4f1e329521afde531efd962808c 100755 (executable)
--- a/do_merge
+++ b/do_merge
@@ -6,14 +6,23 @@ build_dir="/scratch/sfr/next"
 build_cmd="bin/build_next"
 
 no_build=false
+start_from=""
+
 [ "$1" = "-n" ] && {
        shift
        no_build=true
 }
+[ "$1" = "-s" ] && {
+       shift
+       start_from="$1"
+       [ -z "$start_from" ] && {
+               echo "-s requires a start tree" 1>&2
+               exit 1
+       }
+       shift
+}
 [ -n "$1" ] && build_host="$1"
 
-cp /dev/null $LOG_FILE
-
 log()
 {
        echo "$@" | tee -a $LOG_FILE
@@ -26,8 +35,11 @@ execute()
        return ${PIPESTATUS[0]}
 }
 
-execute git checkout master
-execute git reset --hard stable
+[ -n "$start_from" ] || {
+       cp /dev/null $LOG_FILE
+       execute git checkout master
+       execute git reset --hard stable
+}
 
 heads=$(grep -v '^#' ../real_control | awk -F '        ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
 
@@ -36,6 +48,15 @@ need_build=false
 for h in $heads; do
        tree=${h%/*}
        [ "$tree" == "quilt" ] && tree=${h#quilt/}
+
+       [ -n "$start_from" ] && {
+               if [ "$tree" = "$start_from" ]; then
+                       start_from=""
+               else
+                       continue
+               fi
+       }
+
        log Merging $h
        old_head=$(git rev-parse HEAD)
        execute git merge $h || {