3 # this script sets up a Subversion repository for Makefile in the
4 # first ever git merge, as if it were done with svnmerge (SVN 1.5+)
11 svnadmin create foo.svn
12 svn co file://`pwd`/foo.svn foo
17 svn commit -m "(r$i) $*" >/dev/null || exit 1
22 echo "
\e[1m * $*
\e[0m"
29 svn add trunk branches
30 i=$(commit $i "Setup trunk and branches")
32 git cat-file blob 6683463e:Makefile > trunk/Makefile
33 svn add trunk/Makefile
35 say "Committing ANCESTOR"
36 i=$(commit $i "ancestor")
37 svn cp trunk branches/left
39 say "Committing BRANCH POINT"
40 i=$(commit $i "make left branch")
41 svn cp trunk branches/right
43 say "Committing other BRANCH POINT"
44 i=$(commit $i "make right branch")
46 say "Committing LEFT UPDATE"
47 git cat-file blob 5873b67e:Makefile > branches/left/Makefile
48 i=$(commit $i "left update 1")
50 git cat-file blob 75118b13:Makefile > branches/right/Makefile
51 say "Committing RIGHT UPDATE"
53 i=$(commit $i "right update 1")
55 say "Making more commits on LEFT"
56 git cat-file blob ff5ebe39:Makefile > branches/left/Makefile
57 i=$(commit $i "left update 2")
58 git cat-file blob b5039db6:Makefile > branches/left/Makefile
59 i=$(commit $i "left update 3")
61 say "Making a LEFT SUB-BRANCH"
62 svn cp branches/left branches/left-sub
64 i=$(commit $i "make left sub-branch")
66 say "Making a commit on LEFT SUB-BRANCH"
67 echo "crunch" > branches/left-sub/README
68 svn add branches/left-sub/README
69 i=$(commit $i "left sub-branch update 1")
71 say "Merging LEFT to TRUNK"
74 svn merge ../branches/left --accept postpone
75 git cat-file blob b5039db6:Makefile > Makefile
77 i=$(commit $i "Merge left to trunk 1")
80 say "Making more commits on LEFT and RIGHT"
81 echo "touche" > branches/left/zlonk
82 svn add branches/left/zlonk
83 i=$(commit $i "left update 4")
84 echo "thwacke" > branches/right/bang
85 svn add branches/right/bang
86 i=$(commit $i "right update 2")
88 say "Squash merge of RIGHT tip 2 commits onto TRUNK"
91 svn merge -r$pre_right_update_1:$i ../branches/right
92 i=$(commit $i "Cherry-pick right 2 commits to trunk")
95 say "Merging RIGHT to TRUNK"
98 svn merge ../branches/right --accept postpone
99 git cat-file blob b51ad431:Makefile > Makefile
100 svn resolved Makefile
101 i=$(commit $i "Merge right to trunk 1")
104 say "Making more commits on RIGHT and TRUNK"
105 echo "whamm" > branches/right/urkkk
106 svn add branches/right/urkkk
107 i=$(commit $i "right update 3")
108 echo "pow" > trunk/vronk
110 i=$(commit $i "trunk update 1")
112 say "Merging RIGHT to LEFT SUB-BRANCH"
115 svn merge ../right --accept postpone
116 git cat-file blob b51ad431:Makefile > Makefile
117 svn resolved Makefile
118 i=$(commit $i "Merge right to left sub-branch")
121 say "Making more commits on LEFT SUB-BRANCH and LEFT"
122 echo "zowie" > branches/left-sub/wham_eth
123 svn add branches/left-sub/wham_eth
124 pre_sub_left_update_2=$i
125 i=$(commit $i "left sub-branch update 2")
127 echo "eee_yow" > branches/left/glurpp
128 svn add branches/left/glurpp
129 i=$(commit $i "left update 5")
131 say "Cherry pick LEFT SUB-BRANCH commit to LEFT"
134 svn merge -r$pre_sub_left_update_2:$sub_left_update_2 ../left-sub
135 i=$(commit $i "Cherry-pick left sub-branch commit to left")
138 say "Merging LEFT SUB-BRANCH back to LEFT"
141 # it's only a merge because the previous merge cherry-picked the top commit
142 svn merge -r$sub_left_make:$sub_left_update_2 ../left-sub --accept postpone
143 i=$(commit $i "Merge left sub-branch to left")
146 say "Merging EVERYTHING to TRUNK"
149 svn merge ../branches/left --accept postpone
151 i=$(commit $i "Merge left to trunk 2")
152 # this merge, svn happily updates the mergeinfo, but there is actually
153 # nothing to merge. git-svn will not make a meaningless merge commit.
154 svn merge ../branches/right --accept postpone
155 i=$(commit $i "non-merge right to trunk 2")
159 svnadmin dump foo.svn > svn-mergeinfo.dump