summarylogtreecommitdiffstats
path: root/update-branch.sh
blob: 7326e37949d0774d0d573f7cad82c1b0dc708315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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"