clamav/libclamav/c++/merge.sh

34 lines
1.3 KiB
Bash
Raw Normal View History

2009-08-24 16:38:44 +03:00
#!/bin/sh
# Merge upstream LLVM from git-svn mirror
set -e
rm -f .git/info/grafts
touch .git/info/grafts
echo "Creating grafts for llvm-upstream"
REPONAME=llvm
REFPFX=refs/tags/merge-$REPONAME-
UPSTREAM=$REPONAME-upstream/release-2.8
2009-08-24 16:38:44 +03:00
git for-each-ref $REFPFX* --format='%(refname)' | while read tag_ref
do
tag_svn_ref=`echo $tag_ref|sed -e s\|$REFPFX\|\|`
upstream_ref=`git log $UPSTREAM -1 --grep=trunk@$tag_svn_ref --format=format:%H`
local_ref=`git rev-parse $tag_ref`
local_parent_ref=`git rev-parse $tag_ref^`
2009-12-15 16:57:03 +02:00
git branch --contains $local_ref | grep '*' >/dev/null ||
{ echo "branch has been rebased, tag is on branch: `git branch --contains $local_ref`"; exit 1;}
2009-08-24 16:38:44 +03:00
echo "$local_ref $local_parent_ref $upstream_ref" >>.git/info/grafts
done
echo "Merging llvm-upstream"
MERGEREV=`git log $UPSTREAM -1 |grep /release_28@|sed -s 's/.*@\([0-9]*\).*/\1/'`
2010-03-22 11:42:27 +02:00
echo "$MERGEREV"
git merge -s subtree --squash llvm-upstream/release-2.8
2010-03-22 11:42:27 +02:00
echo "Run strip-llvm.sh from libclamav/c++"
echo "Then fix conflicts if needed: git mergetool"
echo "Then commit the result and tag it: git commit && git tag merge-llvm-$MERGEREV"
echo "Then remove the grafts: rm .git/info/grafts"
# && git commit || {
# echo "Merge failed: resolve conflicts and run: git tag merge-llvm-$MERGEREV && rm .git/info/grafts"; exit 1;}
# git tag merge-llvm-$MERGEREV
# rm .git/info/grafts