PayPal
Personal tools
Namespaces
Variants
Actions

Patch Submission Guidelines

From mangos

Jump to: navigation, search

Please try to include the following information:

   * What bug does the patch fix? What features does the patch add?
   * For which repository revision was the patch created?
   * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.
   * Who has been writing this patch? Please include either forum user names or email addresses.

Some additional hints

   * If there is no bug report thread for a bug fix patch you do want to submit, please create a proper bug report first.
   * Please make sure, that the patch submitted only contains changes for the particular bug fix or feature addition and no other changes.
   * Whenever possible, run a git-pull prior to making patches. If possible use the current git revision to create your patch.
   * Please add comments to your code. If you add new features, try to add Doxygen comments.
   * If your patch is only small (read: not more than 20 changed lines of code), you can use the CODEBOX tag to include the patch in your post.
   * For larger patches, use paste2.org to upload your patch.

Credit to: TheLuda


Creating a Patch to Git

So you've found a bug you want to fix, or a feature you want to implement, thanks! If you follow this guide it will make it much easier for the community to review your changes, and the core team to get them included in the next release. If you need an introduction to git, check out the tutorial and Everyday GIT With 20 Commands Or So.

Making Your Changes

The first thing you need to do is obtain a clone of the MaNGOS repository

$ git clone git://github.com/mangos/mangos.git $ cd mangos

Then you need to create your new branch:

$ git checkout -b make_mangos_scale

Switched to a new branch "make_mangos_scale"

Now you're ready to get hacking. Be sure to include tests which demonstrate the bug you're fixing, and fully exercise any new features you're adding. You should also take care to make sure the documentation is updated if you're changing the API. Once you've finished making your changes you need to commit them.

$ git commit -a -m "I made MaNGOS scale by adding quantum tunneling" Created commit 29f8baa: I made MaNGOS scale by adding quantum tunneling 1 files changed, 0 insertions(+), 1 deletions(-)

Preparing your changes for submission.

Now that you've made your changes it's time to get them into a patch. We need to update rails and fix any conflicts we had.

$ git checkout master Switched to branch "master" $ git pull ... $ git checkout make_mangos_scale Switched to branch "make_mangos_scale" $ git rebase master

Once you've fixed any conflicts, you're ready to create a patch:

$ git format-patch master --stdout > make-mangos-scale.diff

Now you can attach that patch file to a lighthouse ticket and add the 'patch' tag. Once you have a patch and a lighthouse ticket you need to find some people to give you feedback. You can either email the core list or ask in #mangos-contrib on irc.freenode.net

Reviewing Changes

To apply someone's changes you need to first create a branch:

$ git checkout -b koz_made_mangos_scale

Then you can apply their patch

$ git am < their-patch-file.diff

Once you have a working copy, you should take note of the following kinds of things:

   * Are you happy with the tests, can you follow what they're testing, is there anything missing
   * Does the documentation still seem right to you
   * Do you like the implementation, can you think of a nicer or faster way to implement a part of their change

Once you're happy it's a good change, comment on the lighthouse ticket indicating your approval. Your comment should indicate that you like the change and what you like about it. Something like:

      1. I like the way you've restructured that code in Server namespace, much nicer. The tests look good too.

If your comment simply says +1, then odds are other reviewers aren't going to take it too seriously. Show that you took the time to review the patch. Once three people have approved it, add the verified tag. This will bring it to the attention of a committer who'll then review the changes looking for the same kinds of things. Congratulations and Thank You!

Once your changes have been applied, you've officially become part of the large community of independent contributors working to improve MaNGOS. Important Notes

   * MaNGOS core team prefers that you create a github fork only for large changesets which are likely to involve a lot of code reviews/changes back and forth, or if 2 or more people are working on the same feature/bug. But of course, like all the rules, exceptions can be made for cases that demands for it.

(Some revisions need to be made for outdated data)

Navigation
Interaction
Toolbox