How to contribute
Following the spirit of a true open source effort, we invite the community to contribute with new features and bug fixes. Bug fixes go both into the master and nextRelease branches, and new features go only into the nextRelease branch.
The procedure for contribution of new features is as follows:
- First, make sure to have an account on SourceForge.Net. You will need to be logged-on on SourceForge.Net for completing some of the next following steps.
- Browse to http://sourceforge.net/p/foam-extend/foam-extend-3.0/ci/master/tree/
- Click on the “Fork” button to create your own fresh fork of foam-extend-3.0
Just accept the default settings at the next page (just take a note of the Project label, in my case “u/userid-1780047”) and click on “Fork” again.
Wait a little while to make sure that everything is forked completely before proceeding (otherwise you may get an error message saying “possible repository corruption” in the next stage)
- At http://sourceforge.net/p/foam-extend/foam-extend-3.0/ci/master/tree/, click on “Forks” (note the “s”!), and you should be able to browse to your fork (the Project label you took a note of above) and get instructions on how to clone it. In my case:
mkdir ~/foam; cd ~/foam
git clone ssh://hakan_nilsson@git.code.sf.net/u/userid-1780047/foam-extend foam-extend-3.0
- Go to your local git repository and switch to the nextRelease branch (this is the platform for which your code must work!)
cd ~/foam/foam-extend-3.0
git checkout nextRelease
- Compile foam-extend-3.0 as usual
- Copy you contribution to the appropriate location of the directory structure, and do the modifications you need. Make sure that the code is bug-free, that it works in the nextRelease branch, and that you did not break anything in the nextRelease branch.
- Create and checkout a feature branch. In the example below, ‘feature’ should be a one-word short description of your contribution. Of course, your name will be added to the long list of contributors of this great piece of software. So please no nicknames, only real names for posterity.
git checkout -b nr/YourfirstnameYourfamilyname_feature
- Clean up your files so that only source files will be added! I.e. remove files that are generated when compiling your contribution, or running tutorial cases that you have added.
- Add, commit and push your contribution to your new feature branch.
Use “git add” to add your contributions to your local repository.
Use ‘git commit -m “Descriptive commit message”’ to commit it to your local repository. The descriptive commit message is very important, since it will be the basis of the release notes.
Push your contribution to the remote repository:
git push origin nr/YourfirstnameYourfamilyname_feature
- At http://sourceforge.net/p/foam-extend/foam-extend-3.0/ci/master/tree/, click on “Forks” and browse to your fork. Make sure that your new branch is there (under “Branches”, click on “More Branches”).
- Request a merge by clicking on “Merge Request”. Write descriptive “Summary” and “Description”. Select your newly created branch as “Source Branch”, and select the nextRelease branch as the “Target Branch”. Then click on “Save” and the administrators will be notified of your request.
- It is preferable if you use the OpenFOAM Wiki for a more detailed description of your accepted contributions.
If your fork becomes obsolete, you can delete it:
- Go to your fork at SourceForge
- Click on “Admin”
- Click on “Tools”
- Under “Installed Tools”, find your branch and click on “Delete”.