Development/Contributing/Patches

We love patches, and bug reports with patches attached are especially welcome. Patches will need to be created against the latest development version of Elgg either from Subversion or Github.

All patches are expected to conform to our latest coding standards http://code.elgg.org/elgg/trunk/CODING.txt.

Contents

Via Github

Github is the preferred method of contributing to Elgg. It provides a much simpler, more maintainable, and even more fun workflow than the historical SVN method.

  1. Register on https://trac.elgg.org and accept the ticket
  2. Sign up at https://github.com
  3. Fork https://github.com/Elgg/Elgg
  4. Modify your fork
  5. Submit a pull request (mention the relevant ticket)

If you're not familiar with Git or github, https://github.com has lots of great documentation on how to use both

If you're not comfortable with git(hub), you can help us out the old-school way:

Via Subversion

Resolve your issue

  • Resolve your issue by making changes to your working copy of the Elgg Subversion repository. Be careful what editor you use, some will change line endings making the patches very difficult to read because every line will show as changed. A discussion of possible editors is here.
  • Test your changes. Make sure everything works as expected.

Create your patch

A simple patch is a diff between two files: the modified code you created with a bug fix or enhancement and the original file you started with from svn. A patch can be a collection of changes in multiple files or even the creation of a new file. When you name your patch, make sure to give your file a .diff extension, since this lets the Elgg issue tracker recognize it as a patch, enabling syntax highlighting.

Using a graphical SVN client

We recommend TortoiseSVN for Windows users, but any decent SVN client will do. You should be able to right click on the base directory (the directory that contains the htaccess_dist file) and select Create Patch from the context menu. It will then show you a list of files that have been changed, added, or deleted compared to the svn version. Select the files that make up your fix and save the file with a .diff extension.

Using the command line

After this the following should only show the changes you have made:

svn status

Now create your patch, by redirecting the output of `svn diff` to an appropriately named file, which preferably includes the revision number of your repository checkout (use `svn info` to determine):

svn diff > 1202_my_issue.diff

Submit to trac

  • Log into the Elgg Tracker, create a new ticket for your bug report and be sure to check the I have a file to attach checkbox
  • Upload the patch.

Search docs