[khronos-opencl-headers] 04/04: merge svn history with snapshot history
Andreas Beckmann
anbe at moszumanska.debian.org
Mon Sep 21 02:38:57 UTC 2015
This is an automated email from the git hooks/post-receive script.
anbe pushed a commit to branch from-svn-to-git
in repository khronos-opencl-headers.
commit 99f5f4557d94b372b31d908097357913252c05b6
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon Sep 21 04:23:32 2015 +0200
merge svn history with snapshot history
---
04-merge | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++
svn-to-git.utils.sh | 17 +++++++
2 files changed, 148 insertions(+)
diff --git a/04-merge b/04-merge
new file mode 100755
index 0000000..646f5ea
--- /dev/null
+++ b/04-merge
@@ -0,0 +1,131 @@
+#!/bin/sh
+set -e
+#set -x
+
+lib=svn-to-git.utils.sh
+self=$(readlink -f $0)
+selflib=$(dirname $self)/$lib
+. "$selflib"
+
+test -n "$1" || exit 0
+test -d "$1" || exit 0
+test -n "$2" || exit 0
+test ! -d "$2" || exit 0
+
+cp -a "$1" "$2"
+
+cd "$2"
+
+# split a merge
+mrg=9621fe2275c42297cd3046fdba588eaa1f5f8202
+git tag mrgtodo $mrg^2
+reparent $mrg $mrg^1
+
+dvers=$(for t in $(git tag --list "snapshot/*") ; do basename "$t" ; done)
+upstream=$(echo "$dvers" | head -n 1 | awk '{ print $1 }')
+upstream=${upstream%-*}
+
+git branch master upstream/$upstream
+git checkout master
+
+git tag merge/1.2-2012.04.18a debian-svn/1.2-2012.04.18a-1~3
+git tag merge/1.2-2013.02.12 debian-svn/1.2-2013.02.12-1~3
+git tag merge/1.2-2013.06.28 debian-svn/1.2-2013.06.28-1~3
+git tag merge/1.2-svn26009 debian-svn/1.2-svn26009-1~1
+
+last=
+for v in $dvers
+do
+ case "$v" in
+ *_bpo*) continue ;;
+ esac
+ u=${v%-*}
+ if [ "$u" != "$upstream" ]; then
+ if [ -n "$(git tag --list "merge/$u" 2>/dev/null)" ]; then
+ curr="merge/$u^{commit}"
+ git checkout master
+ git cherry-copy $(git rev-list --reverse "$last..$curr")
+ last=$curr
+ #last=$(git rev-parse "$curr")
+ #git tag -d "merge/$u"
+ fi
+ git authorcommitteremaildate-from-commit upstream/$u \
+ git merge --no-edit upstream/$u
+ upstream=$u
+ fi
+ curr="debian-svn/$v^{commit}"
+ git checkout master
+ git cherry-copy $(git rev-list --reverse "$last..$curr")
+ last=$curr
+ git tag tag/$v
+ copy_tag "debian-svn/$v" "debian/$v" "tag/$v"
+ git tag -d "tag/$v"
+ #git tag -d "snapshot/$v"
+done
+
+curr=trunk
+git checkout master
+git cherry-copy $(git rev-list --reverse "$last..$curr")
+
+for v in $dvers
+do
+ case "$v" in
+ *_bpo*) : ;;
+ *) continue ;;
+ esac
+ last="debian-svn/${v%_bpo*}"
+ curr="debian-svn/$v^{commit}"
+ git checkout "debian/${v%_*}"
+ last=$curr^
+ git cherry-copy $(git rev-list --reverse "$last..$curr")
+ git tag tag/$v
+ copy_tag "debian-svn/$v" "debian/$v" "tag/$v"
+ git tag -d "tag/$v"
+ #git tag -d "snapshot/$v"
+done
+
+# take the snapshot tag for the NMU
+there=$(git rev-parse debian/1.2-2014.04.13-1.1^{commit})
+git tag -d debian/1.2-2014.04.13-1.1
+copy_tag snapshot/1.2-2014.04.13-1.1 debian/1.2-2014.04.13-1.1 $there
+
+# redo the merge
+git branch -m master master.real
+git checkout -b master debian/1.0-2010.06.13-2~2
+u=1.1-2010.07.15
+git authorcommitteremaildate-from-commit upstream/$u \
+ git merge --no-edit upstream/$u
+git cherry-copy mrgtodo
+reparent debian/1.1-2010.07.15-1~3 master debian/1.0-2010.06.13-2
+git checkout master.real
+git branch -d master
+git branch -m master.real master
+git tag -d mrgtodo
+
+for v in $dvers
+do
+ if [ "$(git rev-parse debian/$v^{tree})" = "$(git rev-parse snapshot/$v^{tree})" ]; then
+ git tag -d "debian-svn/$v" "snapshot/$v"
+ fi
+ u=${v%-*}
+ if [ -n "$(git tag --list "merge/$u" 2>/dev/null)" ]; then
+ git tag -d "merge/$u"
+ fi
+done
+
+git branch -D trunk
+git branch -D squeeze-backports
+git branch -D wheezy-backports
+git branch -D snapshot
+
+git branch squeeze-backports debian/1.2-2012.04.18a-1_bpo60+1
+git branch wheezy-backports debian/1.2-2013.06.28-2_bpo70+1
+
+rewrite_history
+
+git checkout from-svn-to-git
+script=$(basename $0)
+cp -a "$self" "$script"
+cp -a "$selflib" "$lib"
+git add "$script" "$lib"
+git commit -m "merge svn history with snapshot history"
diff --git a/svn-to-git.utils.sh b/svn-to-git.utils.sh
index 07437ba..cadb1bd 100644
--- a/svn-to-git.utils.sh
+++ b/svn-to-git.utils.sh
@@ -94,6 +94,23 @@ find_sametree_ancestor()
echo "$target_ref"
}
+copy_tag()
+{
+ local old new at hash
+ old=$1
+ new=$2
+ at=$(git rev-parse "${3:-$old}^{commit}")
+
+ hash=$( (
+ echo "object $at"
+ echo "type commit"
+ echo "tag $new"
+ git cat-file -p "$old" | tail -n +4
+ ) | git hash-object -t tag -w --stdin)
+ echo "create refs/tags/$new $hash" | git update-ref --stdin
+}
+
+
move_tag()
{
local tag tag_ref target_ref
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/khronos-opencl-headers.git
More information about the Pkg-opencl-commits
mailing list