Auto-tools/Projects/Mozmill/RepoSetup: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 12: Line 12:
* Pull the 1.4.2 code into a local branch:
* Pull the 1.4.2 code into a local branch:
<pre>git checkout -b mozauto/1.4.2</pre>
<pre>git checkout -b mozauto/1.4.2</pre>
* Now you're on the 1.4.2 branch.  Use git checkout to switch between branches.
* Now you're on a local branch with the 1.4.2 code.  Use git checkout to switch between local branches.


= Getting some stuff Done=
= Getting some stuff Done=

Revision as of 23:15, 25 June 2010

Getting Started

  • Get a github account
  • Fork the mozautomation/mozmill repo (use the github UI for this)
  • Install git on your system
  • Clone your fork using your ssh key URL on github:
git clone git@github.com:<github username>/mozmill.git

Setting up for Development (for 1.4.2)

For work on a maintenance release of mozmill, we'll use the maintenance release branch. Work for the next major version of Mozmill will be done against the "master" branch, which is already set up. Here's how to set up the maintenance branch on your system.

  • Add the mozautomation repo as a remote:
git remote add mozauto git@github.com:mozautomation/mozmill.git
  • Pull the 1.4.2 code into a local branch:
git checkout -b mozauto/1.4.2
  • Now you're on a local branch with the 1.4.2 code. Use git checkout to switch between local branches.

Getting some stuff Done

Let's say we're implementing a bug fix for 1.4.2, here are the steps you'll take:

  • Make sure you're on your local 1.4.2 branch:
git checkout 1.4.2
  • Create another local branch off of your 1.4.2 branch to do your work in:
git checkout -b mynewfeature
  • Do your fix, then when you're ready submit the feature for review - push to your branch to your own repo:
git push origin mynewfeature
  • If the feature is small:
    • Send a pull request with github UI
    • Take your commit URL (from the github UI) and put that in a comment in bugzilla on the bug you're working on.
  • If the feature is large - major refactoring, changes several files etc then make a patch. You specify which other branch your diffing from. So if we want to make a patch on our branch for the changes that we've made against the 1.4.2 branch then we do:
    • git format-patch mozauto/1.4.2 -U8 --stdout > mypatch.diff
    • This gives you a file mypatch.diff which you can now attach to a bug and ask for review.

For those with commit access

With great power comes great responsibility...

  • Apply the change you want to checkin
    • For pull requests: make a new local branch with git checkout -b newfeature and
      git pull ctalbert newfeature
    • For patches: make a new local branch and
      git apply --stat mypatch.diff
    • This will create a branch with the new code
    • Run the tests (if you're paranoid and/or if the committer didn't)
  • Push the code up to mozautomation:
    • Merge to your 1.4.2 branch:
      • git checkout 1.4.2
      • git fetch
      • git merge <theotherbranch>
      • git push mozauto 1.4.2