Skip to content

Merging Pull Requests

dezfowler edited this page Feb 25, 2012 · 2 revisions

Merging pull requests is usually straight forward, especially if the author has followed the Contributing instructions, as the only real rules for pushing to master are:

  1. Whitespace should be correct - tabs rather than spaces and windows-style (CRLF) line endings
  2. Ensure the ant build passes

Doing a sanity check

Before beginning the merge it's best to do a quick sanity check by opening up the pull request on the github site. Things to check for here are:

  1. Is the pull request coming from the author's master branch - if so this could indicate they haven't read the Contributing page and the request may contain a large number of unrelated commits rather than a specific feature or fix for an issue.
  2. Look at the Diff tab and check whether any of the non-provider specific files have changed e.g. mxn.js, mxn.core.js as changes to these file carry the risk of breaking all providers rather than just one.
  3. Perform a cursory check of the code on the Diff tab looking for things like addition of a feature only supported by one provider, any obvious breaking changes and any commented out or debug code (usually and alert() or console.log() call)

If you notice any issues reply to the pull request letting the author know, add comments to specific lines on the Diff tab if appropriate.

Performing the merge

Instructions for performing a manual merge can be found on each pull request page by clicking the "i" on the "automatic merge" banner. The process is:

Step 1: Check out a new branch to test the changes — run this from your project directory

git checkout -b [merge branch name] master

Step 2: Bring in changes for pull request and test using one of the automated test runner html pages if appropriate

git pull [authors fork url] [author's branch to pull from]

Step 3: If required, amend code to ensure formatting is correct and ant build passes then commit your changes

git commit -m '[commit message]'

Step 4: Merge the changes and update the server

git checkout master

git merge [merge branch name]

git push origin master

I would strongly advise against using the github site's Merge button to merge straight into master. If you want to perform a merge this way I suggest switching to the integration branch first, clicking "Merge" on the pull requests you want to bring in and then following the above merge process from the integration branch rather than each individual pull.