UCLA Moodle Workflow Analysis (using GIT)

Summary

Here at UCLA, the team that runs the main campus Moodle installation has decided to move to GIT from SVN. The primary motivation behind this move is that Moodle.org is moving to GIT. It makes sense for us to move because GIT is a distributed VCS, and it will make it easier to stay in sync with Moodle.org.

One hurdle that we are trying to overcome is how to fit GIT into our internal development workflow. As it stands now, SVN nicely fits into our workflow. Let me explain why.

In our workflow, we create feature branches to do most of our development. After the feature is completed, it gets “svn merged” into a develop/test branch. At any given time the resources we have doing testing and development fluctuate. There is no guarantee that the first feature merged into the develop branch will get tested first.

Finally, once a feature is tested, it gets “svn merged” into stage. Testing happens once again there, again in no given order. Once testing is completed on the feature it gets merged into the master, or trunk branch.

SVN merge works nicely because when you do the merge, you can choose either a specific revision, or a range of revisions.

Now onto GIT. GIT appears to work a bit differently. When you do a merge in GIT, you are merging the entire history of a branch up to the changeset specified. GIT does not support merges in the same way that SVN does. I’ve come up with a list of 5 options to accomplish the same, or similar thing in GIT.

Option 2 represents GIT’s equivalent to what we currently do in SVN, but I’m not looking to copy our SVN workflow just for the sake of keeping things the same. I want to do things the “right” way in GIT.

GITWorkflow.png

Proposed workflows to accomplish what is illustrated in the diagram:

Option 1

git merge from a feature branch to develop, then from feature branch to stage, and finally from feature branch to master as the feature graduates its way through the workflow.

What the history would look like on develop/stage/master:

*a37658bd merged in public/private| \|  *a7785c10 another granular commit|  *7f545188  added more text|  *2bca593b added some text to a file|/

Option 2

git merge —squash from the feature branch to develop. Subsequent merges can then be cherry-picked as the feature graduates its way through the workflow. This would be the GIT equivalent to SVN merges.

What the history would look like on develop/stage/master:

*4d4a0da8 merged …*a37658bd merged in public/private*d9484311 merged …

Option 3

git merge cherry-pick each revision from the feature branch to develop. Then continue to use git cherry-pick to merge features to stage and master as they graduate through the workflow.

What the history would look like on develop/stage/master:

*4d4a0da8 did something else unrelated to the below code*a7785c10 another granular commit*7f545188  added more text*2bca593b added some text to a file*4d4a0da8 did another thing unrelated to the above code

Option 4

Do normal merges from feature branch to develop. Then to merge something to stage:

What the history would look like on develop/stage/master:

*4d4a0da8 did something else unrelated to the below code*a7785c10 another granular commit*7f545188  added more text*2bca593b added some text to a file*4d4a0da8 did another thing unrelated to the above code

Option 5

Do normal merges from feature branch to develop. Then to merge something to stage:

What the history would look like on develop/stage/master:

*4d4a0da8 did something else unrelated to the below code*a7785c10 another granular commit*7f545188  added more text*2bca593b added some text to a file*4d4a0da8 did another thing unrelated to the above code

Notes and observations

Option1

Option2

Option3

Option4

Option5

Appendix: Full list of commands

Option 1 Option2 Option3 1.

2.

3.

5.

6.

7.

9.

10.

11.

12.

13.


Revision #11
Created 2011-03-08 18:56:48 UTC by Thompson, Nicholas David
Updated 2011-07-15 18:42:09 UTC by Williamson, James