PR final steps (to squash or not to squash)

Rainer Müller raimue at macports.org
Tue Dec 6 11:56:22 CET 2016


On 2016-12-06 12:42, René J.V. Bertin wrote:
> On Tuesday December 06 2016 11:39:22 Rainer Müller wrote:
> 
>> You do not even need any other repository:
>>
>>   git fetch origin refs/pull/89/head
>>   git checkout -b pull-89 FETCH_HEAD
>>   git rebase origin/master
> 
> Interesting, does that only change things you can later clean up by deleting the topic branch (pull-89)?
> Is the rebase required, even if you have the automatic version of it enabled (rebase/stat=true in ~/.gitconfig, IIRC)?
> 
>> Or you can use tools such as hub(1) to work with GitHub to get the
>> patches and apply them on top of your current branch.
>>
>>   hub am https://github.com/macports/macports-ports/pull/89
> 
> From port:hub, right? What does 'am' stand for (and why not use apply to avoid the local commit)?

This comes from 'git am', which applies a series of commits provided in
mailbox format, usually generated by 'git format-patch'.

The wrapper 'hub am' downloads the patches from GitHub and applies them
with 'git am'. You can also do the same manually, just remember to
append .patch to the pull request URL:

  curl -sLS https://github.com/macports/macports-ports/pull/79.patch \
    | git am

Why would I want to avoid local commits? That would throw away the
commit messages and author information.

Rainer


More information about the macports-dev mailing list