Difference between revisions of "Contribute code"

From Amahi Wiki
Jump to: navigation, search
m
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
* Join the [https://sourceforge.net/mailarchive/forum.php?forum_name=amahi-devel amahi-devel list]
 
* Join the [https://sourceforge.net/mailarchive/forum.php?forum_name=amahi-devel amahi-devel list]
* If it's your first time, grab a copy of the git repo
+
* If you are new to git, you may find this [http://try.github.com/ interactive git tutorial] a nice intro to git
 +
* Install package:
 +
yum install -y git
 +
* If it's your first time, grab a copy of our main git repo
  
       git clone git://git.amahi.org/amahi.git
+
       git clone git@github.com:amahi/platform.git
  
 
* If not, pull any changes from the master repo
 
* If not, pull any changes from the master repo
  
       cd amahi               (the root of the git tree)
+
       cd platform               (the root of the git tree)
 
       git pull
 
       git pull
  
 
* Get yourself familiar with the pieces, and ask questions!
 
* Get yourself familiar with the pieces, and ask questions!
* Make some changes to the code, then test them:
+
 
 +
= 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:
 
* e.g. for testing the platform:
  
       cd platform/platform/html
+
       rails s
      ./script/server
 
  
 
     and access it at http://hda:3000
 
     and access it at http://hda:3000
Line 52: Line 56:
  
  
* 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.
+
* 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|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 [http://git.amahi.org 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.
 
* Please note, once the patch is applied upstream, your name and email WILL be officially in the [http://git.amahi.org 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.
  
* For more details, ask in the [http://forums.amahi.org forums], [https://sourceforge.net/mailarchive/forum.php?forum_name=amahi-devel amahi-devel list], or come by the [http://talk.amahi.org IRC channel]
+
* For more details, ask in the [http://forums.amahi.org forums], [https://sourceforge.net/mailarchive/forum.php?forum_name=amahi-devel amahi-devel list], or come by the [http://talk.amahi.org IRC channel].

Latest revision as of 22:01, 7 April 2014

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 git@github.com:amahi/platform.git
  • 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.