-
Notifications
You must be signed in to change notification settings - Fork 14
Pulling Guide: Inline develop commits
SomeUser has made a tiny change (e.g. adding themselves to AUTHORS; so small that it didn't warrant a feature branch) on their fork, someuser/develop, and has filed a pull request (with id pull-id) to get the code into UKHAS mainstream!
Great, but how do you pull?
Check out the code in the pull request page! It should look really great. Watch out for coding style, tests being written, comments where appropriate, nothing silly going on, copyright headers at the tops of files and all that nonsense. Check there's a story for this feature in the tracker, too, and that it has been Delivered (it should show Accept or Reject as options).
$ git checkout develop
$ git status
# On branch develop
nothing to commit (working directory clean)
Don't get the above? Stop and check your develop branch is clean!
$ git fetch ukhas
$ git merge --ff-only ukhas/develop
Didn't merge successfully? You have local commits to develop which should have been pushed to UKHAS. Rebase them from the latest UKHAS develop (git rebase ukhas/develop develop) and push them first, then continue here.
The history of the develop branch should be linear, with feature branches merging into develop, but there shouldn't be any develop -> develop merges (see git flow model). Therefore you should first try to fast-forward merge in someuser/develop, and if that fails, you will need to rebase their commits.
$ git fetch someuser
$ git merge --ff-only someuser/develop || git rebase someuser/develop develop
Now you've merged their code locally, it's time to check it out! Run nosetests, make sure the code has copyright headers, etc. You can also inspect the code from the github pull request page, which shows changes in the commits to be pulled. As the person pushing the code to UKHAS, you're also responsible for checking it passes tests.
# All ready?
$ git push ukhas develop
Since there's no merge commit, you're going to have to close the pull request manually! Just go to the pull request page and write a short comment, like "Done.", and click Comment & Close. Magic!