Submitting a PR to Pharo git repository using Iceberg

In this blog post, I will go through the steps to submit a PR to the git repository. This tutorial uses Iceberg to clone and push code to Github. As a matter of fact, Iceberg makes it easier to use GitHub on Pharo. The procedure is clearly described starting with forking the Pharo repository.

Pre-requisites:

  • Make sure you have the latest Pharo vm and image (preferably > 6.0 ) running
  • Github account
  • Internet access
  • SSH connection
    • Currently, it is preferable to connect github on iceberg using ssh. So, to follow the next steps check if you have configured github with SSH.
    • Follow these steps to configure ssh with github. or do the following:
      • run ‘ssh-keygen -t rsa’
      • And choose a location for the rsa keys and also a passphrase. For default location and no passphrase press ‘enter’. You will have your keys generated.
      • Go to your github account and click settings.
      • Go to the section ‘SSH and GPG keys’. Click and add and copy paste the contents of the file id_rsa.pub (default loc: ~/.ssh/id_rsa.pub)

Steps to be followed:

  1. Forking
    • Login to your Github account
    • Go to the Github repository https://github.com/pharo-project/pharo
    • Click on ‘fork’ to fork the repo to your accountImage1
    • If the fork is successful you should see a repo named ‘pharo’  in your repositories. You should be able to access it using https://github.com/username/pharo. Here username should be substituted with your username
  2. Cloning
    • Open the pharo image, left click and select tools and iceberg.Screenshot from 2017-06-14 01-23-27
    • Click on the clone repository button and put the ‘git@github.com:pharo-project/pharo.git’  in the first box and in the code subdirectory box put ‘src’ and then click ‘Create repository’.Image2Screenshot from 2017-06-16 17-54-06.png
    • Sometimes at this point in time, the image looks to be hung. Be patient, it takes time, to load during the first time.
    • Now, you would have the repository cloned. You can see the status as ‘Up to date’ if there aren`t any changes it would be as ‘Uncommitted changes’.
  3. Adding a remote and making it default
    • Click on add remote and add your cloned repository id as shown.
    • Right-click on the new remote and make it default pull and push.
  4. Creating a new branch
    • First thing, see if there is already an issue created in FogBugz issue tracker. If there is already an issue which you are sovling, note down the number else create an issue and note down the number.
    • Right-click on the cloned pharo repo and select Pharo>Create new branch from FogBugz issue
    • Write the issue number in the first box, the second box gets automatically filled up with the issue name in few seconds and click ‘create’.
    • The default branch now would be the newly created one.
    • Change you want in the code or add new code.
    • After changing the status in iceberg would not be as ‘Up to date’.
    • Then right click on the repo in iceberg window and click ‘synchronize repository’
    • You should now see a window with all the changes you made. Sometimes it might take a few seconds for this new window to pop up. You can also do a diff if you click on any modified method. Review the changes.
    • Make sure to write a commit message and click on “commit and push onto ‘branch name’ “.
    • And if a pop up comes up enter your username and password of GitHub.
    • You have successfully committed your changes to ‘your’ Pharo repository onto a new branch. Make sure the default push is your clone repo, else it won`t be committed on to the desired repo.
  5. Pull Request
    • Right click on the clone pharo repo and select Pharo>”Create a pull request”.
    • Enter the credentials if asked.
    • In the next section chose the branch in ‘to (base)’ as ‘development’ and write a comment if necessary.
    • And then click on ‘Create pull request’  to submit a PR.

Ta-da! You have successfully submitted a PR.

Troubleshooting:

  • As Iceberg is still in developing phase, you might step into a lot of problems. Most of these are listed on the Iceberg repo Readme.
  • The option of creating a branch from FogBugz issue tracker is enabled only for ‘pharo’ repository as of now.

Video:

References:

Feel free to comment your feedback and queries.

2 thoughts on “Submitting a PR to Pharo git repository using Iceberg

Leave a comment