Contribute code

From Amahi Wiki
Jump to: navigation, search

This is a quick guide for contrinuting code, fixes or develop native apps on Amahi.

yum install -y git
  • If it's your first time, grab a copy of our main git repo
     git clone
  • If not, pull any changes from the master repo
     cd platform                (the root of the git tree)
     git pull
  • Get yourself familiar with the pieces, and ask questions!

Testing your code

  • Make some changes to the code, then test them, better yet, write tests for the code!
  • e.g. for testing the platform:
     rails s
    and access it at http://hda:3000
    you will probably want to turn off 
    dhcp and dns if your server is on the same 
    network as your home HDA
  • You can see your changes with two git tools: status and diff
     git status
  • The status gives you a list of what files were modified, added or removed. you can see changes in your area with:
     git diff --cached
  • When you know you want to modify a file, you add it to the changes to be committed, for example, say a README file:
     git add README
  • For the parts that are added and checked in, you can see the changes with
     git diff
  • This is what will be committed!
  • Then actually commit your changes to your git repo:
     git commit
  • After that you can generate a patch to be sent upstream, e.g. for a patch of the latest commit.:
    1. Go into the patch folder located in the root of the git tree.
    2. git format-patch HEAD^..HEAD

NOTE: When creating the patch title(first line) please put it in YYMMDD-PATCHSEQUENCE#-long-patch-name.patch format. In the long name please include what module you are working on. AKA what application etc..

  • This will generate a file called 0001-my-patch.mbox or similar (type ls -l 00*), which then you can email or pastebin it to someone to be committed upstream. You probably want to configure Git to your liking first to display the email properly.
  • Please note, once the patch is applied upstream, your name and email WILL be officially in the amahi git repo as as contributor, which mean it's in the open and it's crawlable, so please use your PUBLIC name/email accordingly.