Merge pull request #1145 from marcelklehr/fix/contributing-md

Try to clean up CONTRIBUTING.md
pull/1132/merge
John McLear 2012-11-08 08:52:44 -08:00
commit 745a1860ac
1 changed files with 41 additions and 34 deletions

View File

@ -1,49 +1,56 @@
# Developer Guidelines # Developer Guidelines
(Please talk to people on the mailing list before you change this page, see our section on [how to get in touch](https://github.com/Pita/etherpad-lite#get-in-touch))
Please talk to people on the mailing list before you change this page
Mailing list: https://groups.google.com/forum/?fromgroups#!forum/etherpad-lite-dev
IRC channels: [#etherpad](irc://freenode/#etherpad) ([webchat](http://webchat.freenode.net?channels=etherpad)), [#etherpad-lite-dev](irc://freenode/#etherpad-lite-dev) ([webchat](http://webchat.freenode.net?channels=etherpad-lite-dev))
**Our goal is to iterate in small steps. Release often, release early. Evolution instead of a revolution** **Our goal is to iterate in small steps. Release often, release early. Evolution instead of a revolution**
## General goals of Etherpad Lite ## General goals of Etherpad Lite
* easy to install for admins To make sure everybody is going in the same direction:
* easy to use for people * easy to install for admins and easy to use for people
* easy to integrate into other apps, but also usable as standalone
* using less resources on server side * using less resources on server side
* easy to embed for admins
* also runable as etherpad lite only
* keep it maintainable, we don't wanna end ob as the monster Etherpad was
* extensible, as much functionality should be extendable with plugins so changes don't have to be done in core * extensible, as much functionality should be extendable with plugins so changes don't have to be done in core
Also, keep it maintainable. We don't wanna end ob as the monster Etherpad was!
## How to code: ## How to work with git?
* **Please write comments**. I don't mean you have to comment every line and every loop. I just mean, if you do anything thats a bit complex or a bit weird, please leave a comment. It's easy to do that if you do while you're writing the code. Keep in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are worthless * Don't work in your master branch.
* Never ever use tabs * Make a new branch for every feature you're working on. (This ensures that you can work you can do lots of small, independent pull requests instead of one big one with complete different features)
* Indentation: JS/CSS: 2 spaces; HTML: 4 spaces * Don't use the online edit function of github (this only creates ugly and not working commits!)
* Don't overengineer. Don't try to solve any possible problem in one step. Try to solve problems as easy as possible and improve the solution over time * Try to make clean commits that are easy readable (including descriptive commit messages!)
* Do generalize sooner or later - if an old solution hacked together according to the above point, poses more problems than it solves today, reengineer it, with the lessons learned taken into account. * Test before you push. Sounds easy, it isn't!
* Keep it compatible to API-Clients/older DBs/configurations. Don't make incompatible changes the protocol/database format without good reasons * Don't check in stuff that gets generated during build or runtime
## How to work with git
* Make a new branch for every feature you're working on. Don't work in your master branch. This ensures that you can work you can do lot of small pull requests instead of one big one with complete different features
* Don't use the online edit function of github. This only creates ugly and not working commits
* Test before you push. Sounds easy, it isn't
* Try to make clean commits that are easy readable
* Don't check in stuff that gets generated during build or runtime (like jquery, minified files, dbs etc...)
* Make pull requests from your feature branch to our develop branch once your feature is ready
* Make small pull requests that are easy to review but make sure they do add value by themselves / individually * Make small pull requests that are easy to review but make sure they do add value by themselves / individually
## Branching model in Etherpad Lite ## Coding style
* Do write comments. (You don't have to comment every line, but if you come up with something thats a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are worthless!)
* Never ever use tabs
* Indentation: JS/CSS: 2 spaces; HTML: 4 spaces
* Don't overengineer. Don't try to solve any possible problem in one step, but try to solve problems as easy as possible and improve the solution over time!
* Do generalize sooner or later! (if an old solution, quickly hacked together, poses more problems than it solves today, refactor it!)
* Keep it compatible. Do not introduce changes to the public API, db schema or configurations too lightly. Don't make incompatible changes without good reasons!
* If you do make changes, document them! (see below)
## Branching model / git workflow
see git flow http://nvie.com/posts/a-successful-git-branching-model/ see git flow http://nvie.com/posts/a-successful-git-branching-model/
* master, the stable. This is the branch everyone should use for production stuff ### `master` branch
* develop, everything that is READY to go into master at some point in time. This stuff is tested and ready to go out * the stable
* release branches, stuff that should go into master very soon, only bugfixes go into these (see http://nvie.com/posts/a-successful-git-branching-model/ for why) * This is the branch everyone should use for production stuff
* you can set tags in the master branch, there is no real need for release branches imho
* The latest tag is not what is shown in github by default. Doing a clone of master should give you latest stable, not what is gonna be latest stable in a week, also, we should not be blocking new features to develop, just because we feel that we should be releasing it to master soon. This is the situation that release branches solve/handle. ### `develop`branch
* hotfix branches, fixes for bugs in master * everything that is READY to go into master at some point in time
* feature branches (in your own repos), these are the branches where you develop your features in. If its ready to go out, it will be merged into develop * This stuff is tested and ready to go out
### release branches
* stuff that should go into master very soon
* only bugfixes go into these (see http://nvie.com/posts/a-successful-git-branching-model/ for why)
* we should not be blocking new features to develop, just because we feel that we should be releasing it to master soon. This is the situation that release branches solve/handle.
### hotfix branches
* fixes for bugs in master
### feature branches (in your own repos)
* these are the branches where you develop your features in
* If its ready to go out, it will be merged into develop
Over the time we pull features from feature branches into the develop branch. Every month we pull from develop into master. Bugs in master get fixed in hotfix branches. These branches will get merged into master AND develop. There should never be commits in master that aren't in develop Over the time we pull features from feature branches into the develop branch. Every month we pull from develop into master. Bugs in master get fixed in hotfix branches. These branches will get merged into master AND develop. There should never be commits in master that aren't in develop