Skip to content

Committing Changes to the Git Repository

GVogeler edited this page Mar 11, 2015 · 47 revisions

The MOM-CA developer community uses github for collaborative development. In the following, only some minimum information is provided for the handling of a Git repository. It is assumed that your Linux terminal points to the directory where MOM-CA is installed, e.g. to /home/jochen/XRX/mom.XRX. It is also assumed that all changes are commited into the master branch. The general practice in MOM-CA is to fork the repository before working on the code and to create a pull request after submitting your changes to your fork in the github repository.

Update Your Local Codebase

Before committing any changes, update your local codebase with the changes done by other MOM-CA developers using the following command:

git pull origin master

Get Your Local Status

Compile Git Status

The git status command informs about the files, which you have modified, added or removed locally since your last commit.

Please note the following two particularities:

  1. Below the heading Changes not staged for commit, there always appears the modified file build.properties.xml, which you have filled in during installation with individual parameters optimized for your local MOM-CA installation. Please do never commit the build.properties.xml file to the public Git repository since the file contains your private database admin password!

  2. Below the heading Untracked files there always appear two directories (localhost, test) and two files (.XRX.compiler.tmp, xrx.conf.xml). In the localhost directory, the eXist application server was installed during the installation process. The test directory is automatically crated by the Eclipse environment. .XRX.compiler.tmp and xrx.conf.xml are also automatically created utility files relevant for the XRX system. Please do never commit these files and directories as well since they are only relevant for your local MOM-CA installation!

Locally Add New Files

If there are new local directories or files, add them with a command such as:

git add my/XRX/src/mom/app/collection/widget

git add my/XRX/src/mom/app/collection/widget/remove-collection.widget.xml

If there aren't any new files, continue with locally commiting your changes.

Locally Commit and Label Your Changes

Whenever you have finished a single working task, e.g. the creation of a new widget or a bugfix for an existing widget, commit your changes locally with a command such as:

git commit my/XRX/src/mom/app/collection/widget/remove-collection.widget.xml -m 'new widget remove-collection'

git commit my/XRX/src/mom/app/collection/widget/remove-collection.widget.xml -m 'bugfix for widget remove-collection'

git commit my/XRX/src/mom/app/collection -m 'minor changes in app collection'

The quoted text after the -m parameter informs other MOM-CA developers about your changes. Try to formulate the commit messages as accurate as possible so that other MOM-CA developers get a good idea about what you have changed.

It is important to commit all changes in a well formatted way, i.e. to use 2 spaces (no tabs) for code indentaion! Otherwise, other MOM-CA developers have no chance to follow your changes conveniently with the github version difference tool. See the MOM-CA Development Environment guide for more information.

Integrationg Your Changes into the Main Development

Workflow: Forking

MOM-CA follows a "integrator-manager" workflow. That means that every developer stores his changes in his own repository (e.g. a github fork) and asks the intergrator-manager to integrate his changes into the main development repository with a 'pull request'. That means:

Before pushing your changes you have to create a fork:

You can add an abbreviation to the new mom-ca remote repository in your local git repository with

git remote add MyRepo https://github.com/{your git repository name}/mom-ca

Push Your Changes to Your Fork

After you have tested your local changes carefully, push your changes into your fork on the public Git repository with the following command:

git push {MyRepo} master

where {MyRepo} stands for the abbreviation of your mom-ca fork.

Create Pull Request

When you feel like your changes should be deployed in the live system you

  • go to your mom-ca fork
  • select the pull request tab on the right and
  • create a new pull request with some comments on what you have changed

Deployment of the Pull Request

The integrator-manager (currently it's Daniel Jeller in Vienna supported by Georg Vogeler) will then check your changes, merge your changes into the main fork and deploy everything on the live server. If that takes a bit, you can send the integrator-manager-team personal messages to remind them - they are busy ...

Clone this wiki locally