aboutsummaryrefslogtreecommitdiffstats
path: root/helpers/update-branches.sh
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/update-branches.sh')
-rwxr-xr-xhelpers/update-branches.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/helpers/update-branches.sh b/helpers/update-branches.sh
new file mode 100755
index 00000000..b08e1f16
--- /dev/null
+++ b/helpers/update-branches.sh
@@ -0,0 +1,37 @@
+#! /bin/sh
+
+if [ ! -d .git ]
+then
+ echo you must run this script from the top level directory
+ exit 1
+fi
+
+doit () {
+ echo "
+ Running: $@"
+ "$@" || {
+ echo "Oops: command [$@] failed with status $?"
+ return 1
+ }
+}
+
+doit git checkout master || exit
+
+features=$(git branch -a | grep /origin/feature/ | sed 's;.*/origin/;;')
+others="porting"
+
+for i in $others $features
+do
+ echo "
+ Updating branch $i"
+ (doit git checkout $i && doit git pull && doit git merge master && doit git push) || {
+ echo "
+Error encountered updating branch $i.
+Please resolve the conflict and push it manually in a separate window.
+Please hit enter when you are done so we may continue to merge into
+the other branches."
+ read x
+ }
+done
+
+doit git checkout master