summarylogtreecommitdiffstats
path: root/update-branch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update-branch.sh')
-rwxr-xr-xupdate-branch.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/update-branch.sh b/update-branch.sh
new file mode 100755
index 000000000000..7326e37949d0
--- /dev/null
+++ b/update-branch.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+REMOTE_BRANCH=packages/ddclient
+LOCAL_BRANCH=upstream
+CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
+
+git checkout "$REMOTE_BRANCH"
+git pull
+git branch -f "$LOCAL_BRANCH" "$REMOTE_BRANCH"
+git checkout "$LOCAL_BRANCH"
+git filter-branch -f --subdirectory-filter trunk \
+ --tree-filter 'makepkg --printsrcinfo > .SRCINFO || rm .SRCINFO' \
+ --commit-filter '
+ if [ -e .SRCINFO ]
+ then
+ git commit-tree "$@"
+ else
+ shift
+ while [ -n "$1" ]
+ do
+ shift
+ map "$1"
+ shift
+ done
+ fi'
+git checkout "$CURRENT_BRANCH"