Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 53 Next »

Looking to get the Mifos source code? You've come to the right place. Instructions on getting the Mifos source code through our Git repository can be found below

Effective use of version control is critical to effective team collaboration on Mifos. Our version control system is how we communicate code changes with one another.

Browse Source

Download a snapshot

  • Download the latest code without version control

If you want to do download source code of some previous release then you should browse the repository and use "snapshot" link to download that code as a tar.gz archive.

Developer Setup

Follow this section completely before cloning any Mifos repositories!

Install Git

Install Git on Windows

  • Install msysGit (look for a file named similarly to Git-1.7.0.2-preview20100309.exe)
  • select default components
  • in "Adjusting your PATH environment" select "Run Git from the Windows Command Prompt"
  • choose the default for the "Configuring the line ending conversions": "Checkout Windows-style, commit Unix-style line endings"

Install Git on Ubuntu

sudo apt-get install git-core

You may also find Step 4 of the Ubuntu install guide to be a handy reference.

Install Git on Mac OS

To install using macports, follow instructions here.

Alternately, an installer (.dmg) can be found at git's web site. (This .dmg file has been found to work just fine on Snow Leopard as well, despite being labeled as for Leopard.)

Line endings

Tell Git to handle line endings for you so folks on different platforms can live in harmony.

Windows

Do this on the Git Bash MINGW msysGit command line:

git config --global core.autocrlf true

Linux and Mac

Do this:

git config --global core.autocrlf input

More info

Author Info

To make all commits clear/legible/accessible, please configure git to use your full, real name and email. This means...

user.name must be your real/legal first and last name. Do not abbreviate either. If you have more than two names, pick the two you are most commonly known by.

For example:

git config --global user.name "Joe Example"

user.email must be a working email address. This address should be permanent, ie: not something that will change when you change jobs.

For example:

git config --global user.email joe@example.com

Day to day usage

For a quick summary, see the Git homepage.

Clone

For svn users: this is similar to "svn checkout"--you'll get source code you can examine and modify.

For read-only access:

git clone git://github.com/mifos/REPOSITORY_NAME.git

Where REPOSITORY_NAME is "head", or any of the repositories listed at https://github.com/mifoshttp://mifos.git.sf.net/ (also see below for tables explaining purposes of the various repositories). To clone the head repository:

git clone git://github.com/mifos/head.git

Create an account on github. Read-write access uses a url, and permission granted by a current Mifos maintainer.

git@github.com:mifos/head.git

Which repository should I clone?

Active/current repositories

repository

purpose

bi

Mifos business intelligence code.

cloud

Code related to the Mifos cloud.

documents

Mifos documentation and various files that don't belong in head.

head

Most work on the Mifos MIS Java Web application happens here. Many development branches exist. Mifos release maintenance branches are also found in head, one for each release since 1.6.x.

maven

Maven-related code used for building code in the head repository.

plugins

Mifos plugins. Projects in this repository build plugins to assist with imports of various kinds of transactions into Mifos.

www

Code for mifos.com and mifos.org.

Archived/deprecated/old/inactive repositories

repository

purpose

cheetah

A spike on a complete Mifos rewrite. Mostly incorporated into head.

htmlcss

Static version of Mifos UI used during a Summer of Code 2010 CSS redesign project.

marketplace

An old spike.

1.4.x

"master" in this repository is an old (1.4.x) release maintenance branch. See head for code for 1.6.x and later releases.

1.5.x

"master" in this repository is an old (1.5.x) release maintenance branch. See head for code for 1.6.x and later releases.

Key-based auth

Github help is a great resource http://help.github.com/

Commit to your local repository

Add files to the git "index" so they will be committed with "git add". Optionally, instead of running "git add", include -a when running "git commit" to commit all local modifications except new files. Then, commit:

git commit

In Git, the first 80 characters of the first line are, by convention, a summary of the rest of the log message. See Commit Log Guide.

Push changes to a remote repository

If the remote repository is called "origin", you might do:

git push origin master

Update your master branch

git pull --rebase origin master

Using rebase is recommended to keep the commit history graph clean. Specifically, trivial merges cause a great deal of clutter. We may eventually institute a server side hook to prevent trivial merges.

Creating a patch

Here are two suggestions.

1) Create an emailable (or JIRA-attachable) patch from your last local commit:

git format-patch origin/master

2) If you have a public git repository, create a pull request, with for example something like this:

git request-pull -p 5e5303a9328b4e620c58ec1f69fbb2118077d594 git://github.com/vorburger/mifos-head.git

Either way, send the output to the mifos-developer mailing list, and describe your patch following Commit Log Guide.

Branching basics

Please refer to Pro Git: Basic Branching and Merging.

Creating a local branch

git branch NAME_OF_BRANCH

Deleting a local branch

git branch -d NAME_OF_BRANCH

List branches

Local branches can be listed with:

git branch

To see all "remote" branches:

git branch -a

Note that "remote branch" really means a local copy of a remote branch.

Merging in changes from another branch

git checkout BRANCH_TO_MERGE_CHANGES_TO
git merge OTHER_BRANCH

Resolving merge conflicts

http://stackoverflow.com/questions/161813/how-do-i-fix-merge-conflicts-in-git

Tagging

Releases

The release tag naming convention is simply the exact version number of the release. This tag should be created on the release branch/fork. The tag should be GPG-signed by a Mifos maintainer.

Example done for the 1.5.0 release:

git tag -s 1.5.0 f32b705f09b879bc91324f31cbcbff87637d9fb3
git push --tags origin

Builds

Hudson automatically tags commits as they are built. These are currently only stored locally in Hudson's clones. It might be convenient to automatically propagate these tags elsewhere.

Where to get more help

Eclipse IDE Integration

EGit provides "Team" (version control) capabilities in Eclipse.

EGit does not yet support comparing full trees.

For Mifos administrators and curious contributors

Why Git?

  • vibrant community
  • mature, stable toolkit
  • got help from former Mifos volunteer and git user Tom Bostelmann
  • separate committer and author fields

Legacy version control

Mifos source code was originally hosted in Subversion. Not everything was imported from Subversion. Neither git-svn nor svn2git could parse Svn 1.5+ mergeinfo, so multiple branches could not be imported simulataneously.

We chose to create multiple git repositories on sf.net, one for every long-lived release branch. Development branches may still be created and shared according to the above documentation.

How to migrate a Subversion branch to Git

Locally, pull down a branch from Subversion:

mkdir mifos-1.5.x && cd mifos-1.5.x
git svn init https://mifos.svn.sourceforge.net/svnroot/mifos/branches/v1.5.x
git svn fetch

This will take a while. While this is running, create a new git repository at sf net for the branch you are about to copy from Subversion.

Once the pull from svn is complete, you can then push to sf.net:

git remote add origin ssh://meonkeys@mifos.git.sourceforge.net/gitroot/mifos/1.5.x
git push origin master

Mid-migration maintenance

There may be an interim period where the bridge between Subversion and Git must be kept alive. Subversion and Git commits can coexist in "head". To grab the latest from svn and push it to "head":

git svn fetch
git merge remotes/git-svn
git push origin master

To move your changes past all svn changes in your local git-svn clone, do:

git svn rebase
git push origin master

If you lose your original git-svn clone of, say, /branches/1.5.x, you can do the following to hook a clone of the 1.5.x repo back up to the corresponding branch in svn:

git config svn-remote.svn.url https://mifos.svn.sourceforge.net/svnroot/mifos/branches/v1.5.x
git config svn-remote.svn.fetch ':refs/remotes/git-svn'

Then try rebase/push as mentioned above.

Hook scripts

In use

All hook scripts used on the sf.net repositories are committed to resources/scripts/githooks in head.

Here's what I did for the cia.vc pinger scripts:

  1. manually copied them into sf.net shell, "~" directory via scp
  2. SSH'd into sf.net shell
  3. copied scripts into /home/scm_git/m/mi/mifos/head/hooks/
  4. from "hooks" dirs of other projects, symlinked to the hook scripts in the "head" hooks dir (so only one version of the scripts needs to be maintained)

Note that the "update" script uses a different path to ciabot.bash than you'd expect based on the git repository paths on sf.net when you SSH in (the repositories aren't in /home/scm_git when the hook scripts are executing).

Testing

The "hooktest" repository can be used for testing hook scripts. If "hooktest" is missing, a new empty repository can be created.

Backups

Backups are done using the git client (to maintain bare clones of repositories at sf.net) and rsync (to maintain files that aren't cloned). They are staged in /home/gitbackup on the backup server.

The gitbackup user performs backups daily as follows:

#!/bin/bash
set -o errexit

for repodotgit in `\ls $HOME/repositories/mifos`
do
    cd $HOME/repositories/mifos/$repodotgit
    repo=`basename $repodotgit .git`
    git fetch --quiet git://mifos.git.sourceforge.net/gitroot/mifos/$repo > /dev/null
    cd - > /dev/null
done

rsync --archive --delete --relative \
    mifos.git.sourceforge.net::gitroot/mifos/*/config \
    mifos.git.sourceforge.net::gitroot/mifos/*/description \
    mifos.git.sourceforge.net::gitroot/mifos/*/hooks \
    $HOME/extra_git_files

See also: http://kerneltrap.org/mailarchive/git/2010/5/20/30749

Test restores were performed by copying the backup back to sf.net and cloning.

We moved from sf.net to github https://groups.google.com/forum/#!topic/mifosdeveloper/ksIORnLVHlA/discussion|https://groups.google.com/forum/#!topic/mifosdeveloper/ksIORnLVHlA/discussion

  • No labels