diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000000..5979d4f7a2 --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,77 @@ +.. _contributing: + +============ +Contributing +============ + +The easiest way to let us know about your awesome work is to send a pull +request on github or in IRC. + +Use **summary (bug #bugzilla bug ID#)** for the commit message. Eg:: + + Improve contributing instructions (bug 1041234) + +Point us to a branch with your new code and we'll +go from there. You can attach a patch to a bug if you're more comfortable that +way. + +Please read the :ref:`style`. + +The Perfect Git Configuration +----------------------------- + +We're going to talk about two git repositories: + +* *origin* will be the main olympia repo at http://github.com/mozilla/olympia. +* *mine* will be your fork at http://github.com/:user/olympia. + +There should be something like this in your ``.git/config`` already:: + + [remote "origin"] + url = git://github.com/mozilla/olympia.git + fetch = +refs/heads/*:refs/remotes/origin/* + +Now we'll set up your master to pull directly from the upstream olympia:: + + [branch "master"] + remote = origin + merge = master + rebase = true + +This can also be done through the ``git config`` command (e.g. +``git config branch.master.remote origin``) but editing ``.git/config`` is +often easier. + +After you've forked the repository on github, tell git about your new repo:: + + git remote add -f mine git@github.com:user/olympia.git + +Make sure to replace *user* with your name. + + +Working on a Branch +~~~~~~~~~~~~~~~~~~~ + +Let's work on a bug in a branch called *my-bug*:: + + git checkout -b my-bug master + +Now we're switched to a new branch that was copied from master. We like to +work on feature branches, but the master is still moving along. How do we keep +up? :: + + git fetch origin && git rebase origin/master + +If you want to keep the master branch up to date, do it this way:: + + git checkout master && git pull && git checkout @{-1} && git rebase master + +That updated master and then switched back to update our branch. + + +Publishing your Branch +~~~~~~~~~~~~~~~~~~~~~~ +The syntax is ``git push ``. Here's how to push the +``my-bug`` branch to your clone:: + + git push mine my-bug diff --git a/README.rst b/README.rst index 326f7c6ba9..4a0e3fc412 100644 --- a/README.rst +++ b/README.rst @@ -10,6 +10,8 @@ If you like what we've done, you may want to check out Mozilla's `Playdoh`_. We took all the cool stuff we did in AMO, SUMO and our other websites, and created a base template for new websites. +Please report bugs or suggest features here: https://bugzilla.mozilla.org/enter_bug.cgi?product=addons.mozilla.org + .. _`addons.mozilla.org`: https://addons.mozilla.org .. _`install docs`: http://olympia.readthedocs.org/en/latest/topics/install-olympia/index.html .. _`irc://irc.mozilla.org/amo`: irc://irc.mozilla.org/amo diff --git a/docs/topics/hacking/contributing.rst b/docs/topics/hacking/contributing.rst index 5449bfc12a..b1cd2f37dc 100644 --- a/docs/topics/hacking/contributing.rst +++ b/docs/topics/hacking/contributing.rst @@ -1,71 +1 @@ -.. _contributing: - -============ -Contributing -============ - -The easiest way to let us know about your awesome work is to send a pull -request on github or in IRC. Point us to a branch with your new code and we'll -go from there. You can attach a patch to a bug if you're more comfortable that -way. - -Please read the :ref:`style`. - -The Perfect Git Configuration ------------------------------ - -We're going to talk about two git repositories: - -* *origin* will be the main olympia repo at http://github.com/mozilla/olympia. -* *mine* will be your fork at http://github.com/:user/olympia. - -There should be something like this in your ``.git/config`` already:: - - [remote "origin"] - url = git://github.com/mozilla/olympia.git - fetch = +refs/heads/*:refs/remotes/origin/* - -Now we'll set up your master to pull directly from the upstream olympia:: - - [branch "master"] - remote = origin - merge = master - rebase = true - -This can also be done through the ``git config`` command (e.g. -``git config branch.master.remote origin``) but editing ``.git/config`` is -often easier. - -After you've forked the repository on github, tell git about your new repo:: - - git remote add -f mine git@github.com:user/olympia.git - -Make sure to replace *user* with your name. - - -Working on a Branch -~~~~~~~~~~~~~~~~~~~ - -Let's work on a bug in a branch called *my-bug*:: - - git checkout -b my-bug master - -Now we're switched to a new branch that was copied from master. We like to -work on feature branches, but the master is still moving along. How do we keep -up? :: - - git fetch origin && git rebase origin/master - -If you want to keep the master branch up to date, do it this way:: - - git checkout master && git pull && git checkout @{-1} && git rebase master - -That updated master and then switched back to update our branch. - - -Publishing your Branch -~~~~~~~~~~~~~~~~~~~~~~ -The syntax is ``git push ``. Here's how to push the -``my-bug`` branch to your clone:: - - git push mine my-bug +.. include:: ../../../CONTRIBUTING.rst