Doing your first change

Hopefully sooner than later you are ready to send your first contribution. You will need to create a Git commit and post it for review to our Gerrit installation. General information about using EGit can be found in the Eclipse EGit Wiki.

The first change (textual)

Procedure 5.7. Making changes

  1. Open any file

    E.g. open Utils.java file.

  2. Make a modification

    E.g. remove the getFreePort method.

  3. Add change to the index

    Use the context menu of the file to access TeamAdd to Index. This moves the change into the index and marks the new version as to be committed.

  4. Commit

    Commit all changes that are in the index.

  5. Writing a commit message

    Make sure that the Gerrit option is enabled and that a line with Change-Id is in the editor field. Follow our Commit Guidelines for writing the message.

  6. Switch to the repository view

    Use the context menu and TeamShow in Repository View to switch to another view to be able to push your changes.

  7. Push

    Use the context menu on the repository and select the Push item.

  8. Select Target

    Select the pre-configured Gerrit repository as the target for your changes and continue by pressing the Next button.

  9. Select Branch

    Select what and where to push things. The default Destination Ref should be refs/for/master and press Next to continue.

  10. Push Confirmation

    Review what and where things are pushed and Finish .

  11. Push Result

    The result should include a set of change numbers of the Gerrit system.

The first change (graphical)

Procedure 5.8. Making changes

  1. Open a Utils.java

  2. Make a modification

  3. Add change to the index

  4. Commit

  5. Writing a commit message

  6. Switch to the repository view

  7. Push

  8. Select Target

  9. Select Branch

  10. Push Confirmation

  11. Push Result

Understanding build failures

After you pushed your changes to Gerrit, the Saros-Gerrit job will be scheduled on the Jenkins CI system. The execution of this job might fail and the most common errors are missing files, build failures due building on an older OSGI/Eclipse version or test failures because the tests are run without SWT/GUI being initialized. The below will help you to identify the reason of the failure.

In case the build has failed it can be difficult to find the error in the ant log. The easiest is to search for . ERROR in the console log of the job. An example for a build failure is Job 24, try to find the error.

Dealing with feedback

Imagine you made three commits on top of each other and have pushed them to Gerrit. Now either you or a reviewer has found something that should be modified in any of the separate changes. The straightforward way is to use the built-in Gerrit support to create a new branch with these changes, make the desired modifications, amend to the old commit and push it to Gerrit again.

Procedure 5.9. Modifying a Change

  1. Fetch from Gerrit

    From within the Git repository view select the context menu and press Fetch from Gerrit

  2. Select a Change

    You will need to select a change or use Control+Space to search for changes.

  3. Pick a local branch name

    Select a name for the local branch.

  4. Start your modification

    You are on a branch that contains your previous change. You are now able to do the desired modification.

  5. Amending your commit

    Once you are done with your modification, enter the commit editor and select the amend button. This will combine your new and old change. The commit dialog will automatically pick the commit message from the previous commit.

  6. Pushing your commits

    If you push your current branch to Gerrit again, Gerrit will update the patches in the changes.

  7. Deleting a branch

    You can now checkout a different branch and delete the old one.