-
Notifications
You must be signed in to change notification settings - Fork 0
Standards
Hi everybody!
I'm hoping this page can document directly, or have links to pages, with documentation regarding coding standards that we all use.
- mcRoot is the stand-in for the top-level of the git work tree. For example, my git repository may live at ~/repos/MethodsCore, but Mike's might be at ~/gitstuff/Mike/MethodsCore. Throughout documentation (and even in some functions) we use mcRoot to refer to this path.
Similar to how SPM does it, custom functions that we write that we anticipate being shared across packages should start with mc_. For example, mc_GenPath.m is used by a variety of our "central" scripts.
This scripts will live in mcRoot/matlabScripts/ and many of our functions will add this path.
There is one major repository, called universe throughout, though your alias for it may vary.
This repository is policed by group policy and review.
Each develop will also have his or her own repository. It is expected that users may freely fetch from this repository, but for the most part only the owner will ever push or write to it.
All of these branches will live in universe
public This branch tracks currently released versions of the repository. It will update slowest.
develop This branch tracks work in progress. Features based on develop will affect the whole repository, or at least several toolboxes. Examples include changes to deployment hooks, large restructuring, etc.
releaseX.Y There will be several of these branches. Each time we are approaching a new release, we will start one of these branches.
Each "toolbox" will have its own set of branches. Let's use the svmbatch toolbox as an example throughout this document.
svmbatch_alpha Rapid iteration. This branch collects features when their developer believes that are reasonably ready to go. Pull requests to svmbatch_alpha should generally only require sign off of the feature's developer.
svmbatch_beta Semi-quick iteration. This branch periodically advances by merging in svmbatch_alpha. Pull requests to svmbatch_beta should only include svmbatch_alpha (or its parents, since it is a frequently moving target). Adoption of pull requests should get at least a +1 from two developers (the pull requester and one other developer). +1's don't necessarily indicate that the new code has been tested, but the diff has been reviewed and looks reasonable.
svmbatch_stable Slower iteration.
-
This branch periodically advances by merging in svmbatch_beta. Pull requests to svmbatch_stable should only include svmbatch_alpha (or its parents, since it is a moving target). Adoption of pull requests should get at least a +1 from two developers (the pull requester and one other developer), but beyond just reading the diff they should actually test it.
-
This branch also periodically advances by merging in develop. This way, any repository wide changes or bugfixes will make their way back to the toolbox branch
For this example, we'll be adding support for libsvm to svmbatch.
- Update your local repository from universe
git fetch universe - Base your new branch off of svmbatch_stable, and name it using toolbox/featurename syntax
git checkout universe/svmbatch_stable -b svmbatch/libSVM_support - Do work in your svmbatch/libSVM_support branch
git commit -am "added support for libSVM" - Perform some sort of testing or sanity check to make sure your code doesn't break anything in a really obvious way.
- Push your feature branch to your repository
git push github/dankessler svmbatch/libSVM_support - Submit pull request to merge your feature branch into svmbatch_alpha using github. Be careful to be sure that your request sets the Base Branch to UMPsychMethodsCore@svmbatch_alpha and NOT develop
- Write up some justification or explanation of what your feature does, and go ahead and adopt the pull request.
For this example, we'll be updating the deployment hooks for the whole repository
- Update your local repository from universe
git fetch universe - Base your new branch off of develop, and name it using core/featurename syntax `git checkout universe/develop -b core/deployment_hooks
- Do work in your core/deployment_hooks branch
git commit -am "updated deployment hooks process" - Perform some semi-rigorous testing to make sure you're not breaking anything.
- Push your feature branch to your repository
git push github/dankessler core/deployment_hooks - Submit pull request to merge your feature branch into develop using github. Your base branch will be UMPsychMethodsCore@develop, and your head branch will be dankessler@core/deployment_hooks
- Write up some justification or explanation of what your feature does, and ideally also mention which issue it addresses.
- Assign the pull request to somebody else. Allow discussion to follow. At least one other person should sign off on it, and they should have at least tested it.
- The assignee accepts the pull request, and develop is updated.