@@ -1118,6 +1118,130 @@ L<http://search.cpan.org/dist/CPANPLUS-YACSmoke/> or
11181118L<http://search.cpan.org/dist/minismokebox/> or
11191119L<http://search.cpan.org/dist/CPAN-Reporter/>.
11201120
1121+ =head1 CPERL
1122+
1123+ The cperl development model is a bit different from perl5 porters.
1124+ This workflow can also be used for bigger projects with lots of
1125+ parallel branches being worked on.
1126+
1127+ See L<perlcperl/DEVELOPMENT SETUP> for the initial setup for C<git
1128+ rerere>, which helps in rebasing all actual branches to master for
1129+ every branch merge. This is needed for every committer.
1130+
1131+ Every non-trivial bugfix or enhancement has to got through a public
1132+ github issue or pull request.
1133+
1134+ A branch needs a prefix, like F<bugfix/>, F<feature/> or F<smoke/>,
1135+ and the GITHUB issue number as prefix, like F<feature/gh24-hash-loop>
1136+ If a branch depends on another branch being worked on, you may use
1137+ F<featurex/gh24-new-hash-loop>, i.e. a F<featurex/> prefix and the
1138+ same github number prefix. Only F<smoke/> branches are smoked by
1139+ Travis CI and Appveyor.
1140+
1141+ So you create a new branch, like F<feature/gh24-hash-loop>, make it
1142+ work locally, rename the branch to F<smoke/gh24-hash-loop>, push it
1143+ and see if the smokers run through on all platforms. Be sure to add
1144+ documentation and a perlcdelta entry also. This is different to p5p,
1145+ where deltas are written afterwards.
1146+
1147+ Then a committer will have to merge the branch. This is vastly
1148+ different to other projects. Before pushing the clean merge, one has
1149+ to fix all conflicts with all other actual branches. To ensure that
1150+ the other branches are still current and not out of date.
1151+ This is done via the B<cp-rb> tool in the C<.git-rr-cache> submodule.
1152+
1153+ Preperation (abbrevations used below):
1154+
1155+ alias g=git
1156+ g alias co checkout
1157+ g alias br branch
1158+ g alias rb rebase
1159+ g alias rbs 'rebase --skip'
1160+ g alias rbc 'rebase --continue'
1161+ g alias ciae 'commit --amend --no-edit'
1162+ alias cp-rb=.git-rr-cache/cp-rb
1163+
1164+ Merge:
1165+
1166+ # ensure your branch is clear, can be merged without conflict
1167+ g co smoke/gh24-hash-loop
1168+ g rb master # or origin/master
1169+ g co master
1170+ g merge smoke/gh24-hash-loop
1171+
1172+ Rebase all branches:
1173+
1174+ cp-rb
1175+
1176+ B<cp-rb> rebases all current branches F<bugfix/>, F<feature/>,
1177+ F<featurex/> and F<smoke/> on the new master. For F<featurex/>
1178+ branches or F<smoke/> branches there might be special rules in the
1179+ F<cp-rb> shell script. In the best case the script finishes without any
1180+ rebase CONFLICT. This might happen when there is no conflict, i.e. if
1181+ you worked on a rarely touched file, or the conflict was already
1182+ resolved before and stored in F<.git-rr-cache>. On a CONFLICT F<cp-rb>
1183+ stops, and you are prompted to either resolve or skip it. The easiest
1184+ is working in Emacs B<magit>, where you see where the rebase stopped,
1185+ which files have conflicts, and by clicking on it, jumps to the
1186+ conflict. Typically you have to merge the conflicts, stage it and
1187+ C<g rbc>, i.e. C<r r> in magit or C<git rebase --continue>. Then start
1188+ F<cb-rb> again, which then runs until the next new conflict. The
1189+ F<.git-rr-cache> stored your conflict resolution, if skipped or staged
1190+ and stored.
1191+
1192+ When F<cp-rb> ran through, your F<.git-rr-cache> changes have to be
1193+ stored, and again rebased.
1194+
1195+
1196+ g co master
1197+ cd .git-rr-cache; g add .; g ci -m'gh24-hash-loop'; cd ..
1198+ g add .git-rr-cache; g ci --amend --no-edit
1199+ # and rebase again
1200+ cp-rb
1201+
1202+ Now only the F<.git-rr-cache> submodule CONFLICT should appear which
1203+ is automatically skipped. If all goes well, check if any branch messed
1204+ up the rebase , i.e. in magit display with C<C-x g l L> all local
1205+ branches, and see if the first commit of a branch is a duplicate of a
1206+ previous branch. This sometimes happens, esp. when you rebase a
1207+ temp. work branch already. This commit needs to be inspected and most
1208+ likely skipped. C<cp-rb> should only be run when the branch is really
1209+ ready to be merged to master, otherwise you have to clean up a lot of
1210+ branches afterwards.
1211+
1212+ Then delete the merged branch:
1213+
1214+ g br -d smoke/gh24-hash-loop; g push :smoke/gh24-hash-loop
1215+
1216+ Then you can do a C<git push -f> of all remaining F<smoke/> branches
1217+ and then a C<git push master>, and then C<git push -f> of the rest.
1218+ This way Travis always displays a green status icon, as master is the
1219+ last pushed branch, not some intermediate smoke branch, which is still
1220+ being worked on.
1221+
1222+ The advantage of this workflow is that you fix branch conflicts based
1223+ on your current work and changes, and not months later, on a branch by
1224+ someone else. All branches are automatically current, based on the
1225+ current master and can be immediately being worked on. The conflicts
1226+ are minimal, and previous conflict resultions are stored in the
1227+ F<.git-rr-cache>.
1228+
1229+ Even merging thousands of commits from perl5 upstream are handled
1230+ easily with the cache. Just this is done with cherry-picking, not
1231+ rebasing.
1232+
1233+ The F<branch-point> branch is special. It is either equal to master or
1234+ one C<.git-rr-cache> commit forwards. A trick when merging a new
1235+ branch is to create a special C<.git-rr-cache> commit in
1236+ F<branch-point>, which contains only the C<.git-rr-cache> submodule
1237+ change. All branches are rebased with C<cp-rb> onto this. Conflicts
1238+ in the last master commit cannot be mixed up then with the
1239+ C<.git-rr-cache>, which will happen several times during a C<cp-rb>
1240+ procedure. After all C<cp-rb> conflicts are resolved, F<branch-point>
1241+ can be fixed up (i.e. merged via C<rebase -i>) with the last master
1242+ commit, to be only one single commit.
1243+
1244+
11211245=head1 WHAT NEXT?
11221246
11231247If you've read all the documentation in the document and the ones
0 commit comments