[MacPorts] WorkingWithGit modified

MacPorts noreply at macports.org
Thu Jun 22 13:40:56 UTC 2017


Page "WorkingWithGit" was changed by raimue
Diff URL: <https://trac.macports.org/wiki/WorkingWithGit?action=diff&version=79>
Revision 79
Comment: Rework instructions for PRs
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: WorkingWithGit
=========================================================================
--- WorkingWithGit (version: 78)
+++ WorkingWithGit (version: 79)
@@ -247,6 +247,8 @@
 
 This section describes how to work on a PR without the need to clone or pull from the PR author's repository. 
 
+==== 1. Check out the pull request locally
+
 Check out - according to [https://help.github.com/articles/checking-out-pull-requests-locally/ GitHub's help] - the pull request {{{#ID}}} to work on as a local branch:{{{BRANCHNAME}}}:
 {{{
 git fetch upstream pull/ID/head:BRANCHNAME
@@ -257,15 +259,49 @@
 curl -sLS https://github.com/macports/macports-ports/pull/<ID>.patch \
  | git am
 }}}
-then pull in changes from upstream, work on it (if required), commit and push to e.g. {{{upstream}}} (i.e. in case the work is ready for production):
+or a wrapper script such as hub
+{{{
+hub am https://github.com/macports/macports-ports/pull/<ID>
+}}}
+
+Put the proposed changes on top of the current upstream/master:
 {{{
 # --rebase option only needed if branch.autosetuprebase not set accordingly
 git pull --rebase upstream master
-
+}}}
+
+==== 2. Test changes and modify commits
+
+Work on the changes if required and commit your modifications.
+
+{{{
+# add changes to the latest commit
+git add Portfile
+git commit --amend
 # in case multiple commits have to be edited use
 git rebase -i
-
-# if missing append "Closes: #ID" to commit messages so that GitHub's PR gets auto-closed
+}}}
+
+==== 3. Publish changes
+
+===== a) Update PR with your changes
+
+For this you have to find the source GitHub repository and branch the PR was created from. You can usually identify this on the GitHub web interface:
+
+{{{
+PR_AUTHOR wants to merge 1 commit into macports:master from PR_AUTHOR:PR_BRANCH
+}}}
+
+Use this information to update the PR by pushing your changes, where `$BRANCHNAME` is the name of the branch you are currently working on:
+
+{{{
+git push https://github.com/$PR_AUTHOR/macports-ports $BRANCHNAME:$PR_BRANCH
+}}}
+
+===== b) Close PR and merge changes to upstream/master
+
+{{{
+# append "Closes: #ID" to the commit messages so that GitHub's PR gets auto-closed
 git commit --amend
 
 git push upstream master
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/WorkingWithGit>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'WorkingWithGit' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list