Skip to content

Instantly share code, notes, and snippets.

@danbietz
Forked from eddiemonge/jqm-patch.md
Created December 21, 2011 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbietz/1507418 to your computer and use it in GitHub Desktop.
Save danbietz/1507418 to your computer and use it in GitHub Desktop.
BSPAN Bug Patching

Tips for jQuery Mobile Bug Patching

Requirements:

Git

If you do not have git installed, check these out:

Get the Code

  1. Open a terminal (command prompt)

  2. Change directory (cd) to your web root directory, whatever that might be:

    cd /path/to/your/root/

  3. Clone your BSPAN fork to work locally

    git clone git@github.com:username/BSPAN---Bluetooth-Sensor-Processing-for-Android.git

  4. Change directory to the newly created dir: BSPAN---Bluetooth-Sensor-Processing-for-Android/

    cd BSPAN---Bluetooth-Sensor-Processing-for-Android

  5. Add the BSPAN - Bluetooth Sensor Processing for Android master repo as a remote. "upstream" is a good name for it

    git remote add upstream git://github.com/BSPAN---Bluetooth-Sensor-Processing-for-Android.git

  6. Get in the habit of pulling in the "upstream" master to stay up to date as BSPAN - Bluetooth Sensor Processing for Android receives new commits

    git pull upstream master

  7. (Mac/*Nix) Build the BSPAN - Bluetooth Sensor Processing for Android source

    make

(Windows) You will need someway to build makefiles

Testing Your Checkout

Open the jQuery Mobile test suite in the browser of your choice.

Navigate to /your-git-root/BSPAN---Bluetooth-Sensor-Processing-for-Android/ or whatever your BSAPN folder is called.

You just cloned and built BSPAN!

Patching a Bug

  1. Find a bug you think you can fix from the list at Issue tracker: https://github.com/t2health/BSPAN---Bluetooth-Sensor-Processing-for-Android/issues

  2. Follow the directions above to checkout a clone of the repository or navigate to your existing checkout

  3. Create a new branch to work in:

    • Always use a branch to work in as working in master will get messy
    • Find the issue number in Github for the bug you want to fix. It will be 4 numbers long.
    • Make sure you start with your up-to-date master
      • git checkout master; git pull upstream master
    • Create and checkout a new branch that includes the ticket (issue_#### where #### is the 4 digit issue number )
      • git checkout -b issue_####
      • This will create a new branch (-b), if it does not exist yet, named issue_#### and then switches you into that branch (checkout)
  4. Open up your favorite text editor and make the changes you want that will fix the issue referenced.

  5. Run tests to confirm that you have not broken anything.

    • Ensure all tests still pass
    • Edit your code if it causes a test to fail
  6. Commit your changes once you are done editing the files and the tests pass:

    • Stage the files to be tracked:
      • git add filename(s) You can use "git status" to list the files you have changed. I recommend NEVER, EVER using "git add . "
    • Once you have staged all of your changed files, go ahead and commit them:
      • git commit -m "Issue #####: Brief description of fix"
    • Then, push your branch with the bug fix commits to your github fork
      • git push origin -u issue_####
  7. Before you tackle your next bug patch, return to the master:

    • git checkout master
  8. Submit a Pull Request to actually submit your patch:

  9. Congratulations, you just submitted your Patch! Thanks for your help.

Thanks to Rick Waldron for the original gist: http://docs.jquery.com/Tips_for_jQuery_Bug_Patching

Feel free to add YOUR tips in the comment section below!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment