contributing code with github pull requests (and more...)

45 views
Skip to first unread message

HeresTomWithTheWeather

unread,
Dec 1, 2011, 2:19:32 AM12/1/11
to opensourc...@googlegroups.com

there have been some really good contributions to oscurrency lately from athens that have had an immediate impact in making life easier for several new timebanks. for instance, categories and neighborhoods can now be easily managed through the admin interface.  the internationalization code coverage is also much better.

this is good news especially since code collaboration for heterogeneous application forks requires more thought than contributing to a gem where generally the code is identical everywhere.

oscurrency is not a cookie-cutter application. every community seems to have different design goals and consequently developers will make custom commits that are not good pull request candidates. however, many commits will be useful to everyone.  the github pull request feature set is extremely helpful for reviewing and accepting code:

http://scottchacon.com/2011/08/31/github-flow.html

the trick is that it is a "pull" request! acceptance of the request means merging in the contributor's branch. but we don't want to merge in the custom commits the contributor didn't mean to share. we just want to merge in the latest commits.  i'm going to propose a recipe that seems like it should work but maybe there's a better solution.

after you have forked the oscurrency/oscurrency repository and set up your environment, you do initial setup:

Initial Setup:

git remote add upstream-fork git://github.com/oscurrency/oscurrency.git
git fetch upstream-fork

To contribute, say want to name your topic branch "jqueryupgrade"

1. git fetch upstream-fork
2. git checkout -b jqueryupgrade upstream-fork/master
3. (for each commit) git cherry-pick SHA1
4. git push origin jqueryupgrade
5. *send pull request for jqueryupgrade branch

in step 1&2, a new topic branch is created off the latest commit of the upstream fork's master branch.
in step 3, commits relevant to the pull request are cherry picked.
in step 4&5, the pull request is made

please let me know if you have any questions or know of a better way to do this. if you're not sure what's going on, the best theoretical intro to git that i've found is here: http://www.eecs.harvard.edu/~cduan/technical/git/

so, what is the "and more" on the subject line?????!!!!!!!!

Railscasts is giving away fabulous prizes for the best pull requests during the month of December. Here are the details:

http://railscasts.com/contest

here is another cool project (crowdfunding) you might want to consider contributing to:

http://catarse.me
https://github.com/danielweinmann/catarse

cheers,
tom

Reply all
Reply to author
Forward
0 new messages