[m-rev.] Handling pull requests

Paul Bone paul at bone.id.au
Mon Jan 7 11:14:45 AEDT 2013


On Mon, Jan 07, 2013 at 10:42:04AM +1100, Peter Wang wrote:
> Hi,
> 
> The simplest way I've seen to handle pull requests is to apply like
> this:  (the url was given in the notification message)
> 
>     curl https://github.com/Mercury-Language/mercury/pull/1.patch | git am -3
> 

To make it clear to non-git people.  git am applies patches including
metadata:

    git-am - Apply a series of patches from a mailbox

    Splits mail messages in a mailbox into commit log message, authorship
    information and patches, and applies them to the current branch.

> You may want to amend the commits before pushing.
> 
> For bigger changes you can create a local branch from a pull request,
> then go from there, e.g. to create `pr3' from pull request #3:
> 
>     git fetch origin pull/3/head:pr3

Again, to spell this one out it means.

    Fetch from the repisotory named 'origin' (see git-remote) the branch
    named pull/3/head and call it pr3 in my local repository.

    This command does not checkout (switch to) the newly created local
    branch.

I had to think about this one before I knew what it ment, I hadn't seen this
usage of fetch before and I didn't know that github created branches for
pull requests.  This was my motivation for spelling these out for other
people less farmilar with git.

> I suggest that we try to keep the history linear and avoid pointless
> merge commits, by rebasing the changes onto the latest master before
> pushing.
> 

Thanks Peter, I agree.  And I think this is pretty standard git usage.  (it may seem
strange for people who've not used git before).

I think the bit that needs discussion is how we do code reviews now that
we're using git and github.  What I'd like to acheive here is a way that any
of us can do code reviews, with any tools we like (eg vim and diff/patch or
github or git & vim).  And that the process should be simple regardless of
which tools we want to use.  Eg: I do not want to "force" github usage onto
anyone.


-- 
Paul Bone
http://www.bone.id.au



More information about the reviews mailing list