]> git.ozlabs.org Git - next-scripts/commitdiff
Add some helpers for the "post merge" trees
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Nov 2008 03:00:45 +0000 (14:00 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Nov 2008 03:00:45 +0000 (14:00 +1100)
rebase_end [new file with mode: 0755]
rebase_on [new file with mode: 0755]

diff --git a/rebase_end b/rebase_end
new file mode 100755 (executable)
index 0000000..c6c27a1
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+LOG_FILE="../merge.log"
+build_host="sprygo"
+build_dir="/scratch/sfr/next"
+build_cmd="bin/build_next"
+
+no_build=false
+[ "$1" = "-n" ] && {
+       shift
+       no_build=true
+}
+[ -n "$1" ] && build_host="$1"
+
+log()
+{
+       echo "$@" | tee -a $LOG_FILE
+}
+
+execute()
+{
+       log "$" $@
+       $@ 2>&1 | tee -a $LOG_FILE
+       return ${PIPESTATUS[0]}
+}
+
+execute git checkout master || {
+       echo "git checkout failed" 1>&2
+       exit
+}
+GIT_EDITOR=: execute git merge temp || {
+       echo merge failed 1>&2
+       bash -i || exit
+}
+execute git branch -d temp
+
+$no_build && exit 0
+
+rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
+       echo Rsync failed 1>&2
+       bash -i || exit
+}
+
+echo "Building using $build_cmd on $build_host"
+ssh "$build_host" "$build_cmd" || {
+       echo Build failed 1>&2
+       bash -i || exit
+}
+
+exit 0
diff --git a/rebase_on b/rebase_on
new file mode 100755 (executable)
index 0000000..ebf1847
--- /dev/null
+++ b/rebase_on
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+LOG_FILE="../merge.log"
+
+no_build=false
+[ "$1" = "-n" ] && {
+       shift
+       no_build=true
+}
+tree="$1"
+base="$2"
+
+log()
+{
+       echo "$@" | tee -a $LOG_FILE
+}
+
+execute()
+{
+       log "$" $@
+       $@ 2>&1 | tee -a $LOG_FILE
+       return ${PIPESTATUS[0]}
+}
+
+execute git checkout -b temp "$tree" || {
+       echo "git checkout failed" 1>&2
+       exit
+}
+log '$' git rebase --onto master "$base"
+git rebase --onto master "$base"
+
+exit 0