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"
30 svn add trunk branches tags
31 i=$(commit $i "Setup trunk, branches, and tags")
33 git cat-file blob 6683463e:Makefile > trunk/Makefile
34 svn add trunk/Makefile
36 say "Committing ANCESTOR"
37 i=$(commit $i "ancestor")
38 svn cp trunk branches/left
40 say "Committing BRANCH POINT"
41 i=$(commit $i "make left branch")
42 svn cp trunk branches/right
44 say "Committing other BRANCH POINT"
45 i=$(commit $i "make right branch")
47 say "Committing LEFT UPDATE"
48 git cat-file blob 5873b67e:Makefile > branches/left/Makefile
49 i=$(commit $i "left update 1")
51 git cat-file blob 75118b13:Makefile > branches/right/Makefile
52 say "Committing RIGHT UPDATE"
54 i=$(commit $i "right update 1")
56 say "Making more commits on LEFT"
57 git cat-file blob ff5ebe39:Makefile > branches/left/Makefile
58 i=$(commit $i "left update 2")
59 git cat-file blob b5039db6:Makefile > branches/left/Makefile
60 i=$(commit $i "left update 3")
62 say "Making a LEFT SUB-BRANCH"
63 svn cp branches/left branches/left-sub
65 i=$(commit $i "make left sub-branch")
67 say "Making a commit on LEFT SUB-BRANCH"
68 echo "crunch" > branches/left-sub/README
69 svn add branches/left-sub/README
70 i=$(commit $i "left sub-branch update 1")
72 say "Merging LEFT to TRUNK"
75 svn merge ../branches/left --accept postpone
76 git cat-file blob b5039db6:Makefile > Makefile
78 i=$(commit $i "Merge left to trunk 1")
81 say "Making more commits on LEFT and RIGHT"
82 echo "touche" > branches/left/zlonk
83 svn add branches/left/zlonk
84 i=$(commit $i "left update 4")
85 echo "thwacke" > branches/right/bang
86 svn add branches/right/bang
87 i=$(commit $i "right update 2")
89 say "Squash merge of RIGHT tip 2 commits onto TRUNK"
92 svn merge -r$pre_right_update_1:$i ../branches/right
93 i=$(commit $i "Cherry-pick right 2 commits to trunk")
96 say "Merging RIGHT to TRUNK"
99 svn merge ../branches/right --accept postpone
100 git cat-file blob b51ad431:Makefile > Makefile
101 svn resolved Makefile
102 i=$(commit $i "Merge right to trunk 1")
105 say "Making more commits on RIGHT and TRUNK"
106 echo "whamm" > branches/right/urkkk
107 svn add branches/right/urkkk
108 i=$(commit $i "right update 3")
109 echo "pow" > trunk/vronk
111 i=$(commit $i "trunk update 1")
113 say "Merging RIGHT to LEFT SUB-BRANCH"
116 svn merge ../right --accept postpone
117 git cat-file blob b51ad431:Makefile > Makefile
118 svn resolved Makefile
119 i=$(commit $i "Merge right to left sub-branch")
122 say "Making more commits on LEFT SUB-BRANCH and LEFT"
123 echo "zowie" > branches/left-sub/wham_eth
124 svn add branches/left-sub/wham_eth
125 pre_sub_left_update_2=$i
126 i=$(commit $i "left sub-branch update 2")
128 echo "eee_yow" > branches/left/glurpp
129 svn add branches/left/glurpp
130 i=$(commit $i "left update 5")
132 say "Cherry pick LEFT SUB-BRANCH commit to LEFT"
135 svn merge -r$pre_sub_left_update_2:$sub_left_update_2 ../left-sub
136 i=$(commit $i "Cherry-pick left sub-branch commit to left")
139 say "Merging LEFT SUB-BRANCH back to LEFT"
142 # it's only a merge because the previous merge cherry-picked the top commit
143 svn merge -r$sub_left_make:$sub_left_update_2 ../left-sub --accept postpone
144 i=$(commit $i "Merge left sub-branch to left")
147 say "Merging EVERYTHING to TRUNK"
150 svn merge ../branches/left --accept postpone
152 i=$(commit $i "Merge left to trunk 2")
153 # this merge, svn happily updates the mergeinfo, but there is actually
154 # nothing to merge. git-svn will not make a meaningless merge commit.
155 svn merge ../branches/right --accept postpone
156 i=$(commit $i "non-merge right to trunk 2")
159 say "Adding subdirectory to LEFT"
163 echo "Yeehaw" > subdir/cowboy
165 i=$(commit $i "add subdirectory to left branch")
168 say "Merging LEFT to TRUNK"
171 svn merge ../branches/left --accept postpone
172 i=$(commit $i "merge left to trunk")
175 say "Make PARTIAL branch"
177 i=$(commit $i "make partial branch")
178 svn cp trunk/subdir branches/partial
180 say "Make a commit to PARTIAL"
183 echo "racecar" > palindromes
185 i=$(commit $i "partial update")
188 say "Merge PARTIAL to TRUNK"
191 svn merge ../../branches/partial --accept postpone
192 i=$(commit $i "merge partial to trunk")
197 i=$(commit $i "tagging v1.0")
198 svn cp trunk tags/v1.0
200 say "Branching BUGFIX from v1.0"
202 i=$(commit $i "make bugfix branch from tag")
203 svn cp tags/v1.0 branches/bugfix
205 say "Make a commit to BUGFIX"
208 echo "kayak" >> subdir/palindromes
209 i=$(commit $i "commit to bugfix")
212 say "Merge BUGFIX to TRUNK"
215 svn merge ../branches/bugfix/ --accept postpone
216 i=$(commit $i "Merge BUGFIX to TRUNK")
220 svnadmin dump foo.svn > svn-mergeinfo.dump