addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [ruby-81] git and patch protocols...

From: Scott C.
Sent on: Wednesday, September 9, 2009 9:22 AM

On Wed, Sep 9, 2009 at 8:15 AM, Jon Seidel<[address removed]> wrote:
> ���
> Hi... I've forked cucumber and patched a couple of bugs.�� Now I want to
> submit them and they (Aslak) wants a diff. Also, I�� forked[masked] and now
> they're now at 0.3.99.

Looking at the cucumber wiki contributing page
(http://wiki.githu...­) it looks
like they'll take a pull request.  You can likely just commit your
change, push it to your cucumber fork on GitHub and then go to that
branch and hit the 'pull request' button to ask Aslak to pull your
change in.

If you want to make it easier on them, you can rebase your work first
(generally something like 'git fetch origin; git rebase
origin/master') which will reapply the work you have done on top of
the current head - making sure if there are any merge conflicts that
you have to deal with them rather than Aslak.

If you really want to actually send them a patch (although some
maintainers don't like having to apply patches instead of pulling git
branches) you can run 'git fetch origin; git format-patch
origin/master' which will create a mbox formatted email of each commit
you've introduced to the codebase - then you can just email those.

If you _really_ want to just create a patch, you can run 'git fetch
origin; git diff origin/master... > feature.patch', though that is the
hardest on the maintainer, since it does not contain parentage like
the other ways do.  It will get stale easily, as patch files do.  The
other methods tell Git what commits your patch/es were based on and so
can help Git do more effective 3-way merges, keeping the changes from
getting stale and not applying over a short time.

You can also just use 'diff' but it has the same problems as the 'git
diff' solution - the patches become stale and are more difficult to
apply for the maintainer.  Plus it's even more work for you than 'git
diff' since I think you would need a second clone to diff against.

I think you'll want to open a ticket in Lighthouse as well and
reference the branch on GitHub (ie: 'schacon/my-fix') so Aslak can
track and close the appropriate ticket when necessary.

Hope that's helpful.  Btw, if you haven't forked cucumber on GitHub
yet, and your work was on a public clone of the main project, you can
contribute by hitting the 'fork' button on the cucumber project on
GitHub while logged in, then taking the 'Your Clone Url' and running
this in your project:

$ git remote add github [address removed]:schacon/cuc­umber.git

Then pushing your work to a remote branch for Aslak like this:

$ git push github master:my-fix

That will push the work in your 'master' branch to the 'my-fix' branch
on your fork on GitHub.  Then hit the 'pull request' button.


Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy