Submitting a Patch

From LinuxMCE
Jump to: navigation, search

LinuxMCE uses the subversion revision control system (similar to CVS) to manage changes to the code base. This guide provides a few basic subversion commands that will help the user to post their first patches, without having to read the subversion handbook.

We'll assume that the user has already installed subversion. For more information about installation read Source Code (SVN Repository).

Updating Source

Before submitting your patch to the repository, update your local copy of the source code to reflect any changes that might have occurred since your initial svn checkout. Your patch will not be accepted if your local code conflicts with the most recent version on the repository.

svn update

If you receive the message

Skipped '.'

that means you aren't currently in the directory where you checked out the source.

Add your changes

Place any new code files into the proper directories on your system and add them individually:

svn add filename.cpp
svn add scriptname.sh

You can review the additions that you have made to the tree by typing

svn status

The letter 'A' indicates additions, a '?' indicates unknown files that have not been added.

Create a Diff File

Create a .diff file, which lists the files that have been changed or added to the source. This way the developers who audit your work can easily find the changes you have made.

svn diff > ../patchname.diff

It is good practice to place the .diff file outside of the source tree or else it will show up itself as an addition to the code base. Finally, look at the .diff file to make sure it only has the changes you intended.

Submit a Patch

At this point, if you have been given an svn account by the devs, type

svn commit

However, the LinuxMCE developers are busy so until you have submitted your first few patches, you won't be given an account. Instead, submit your .diff file and the new or altered code files as attachments to a trac ticket. Make sure to read the rules about Bug Reporting as well, if this is your first time.