Unused variables
[openocd.git] / HACKING
blobdc06b4558e6a0ca0a82c81fcd05f5440bdaac2eb
1 Submitting patches to the OpenOCD Gerrit server:
3 OpenOCD is to some extent a "self service" open source project, so to
4 contribute, you must follow the standard procedures to have the best
5 possible chance to get your changes accepted.
7 The procedure to create a patch is essentially:
9 - make the changes
10 - create a commit
11 - send the changes to the Gerrit server for review
12 - correct the patch and re-send it according to review feedback
15 0. Create a Gerrit account at:
17 http://openocd.zylin.com
19 - On subsequent sign ins, use the full URL prefaced with 'http://'
20   For example:
22         http://user_identifier.open_id_provider.com
24 0.1. Add a username to your profile.
26 After creating the Gerrit account and signing in, you will need to
27 add a username to your profile. To do this, go to 'Settings', and
28 add a username of your choice.
30 Your username will be required in step 2 and substituted wherever
31 the string 'USERNAME' is found.
33 0.2. Add an SSH public key
35 Following the directions for your specific platform:
37         for Windows: help.github.com/win-set-up-git/#_set_up_ssh_keys
38         for OSX:     help.github.com/mac-set-up-git/#_set_up_ssh_keys
39         for Linux:   help.github.com/linux-set-up-git/#_set_up_ssh_keys
41 While these pages describe the setting up of git as well,
42 you should scroll down the page till you get to the section:
43 'Next: Set Up SSH Keys', and follow the steps described.
45 1. Clone the git repository, rather than just
46 download the source. 
48 git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
50 or if you have problems with the "git:" protocol, use
51 the slower http protocol:
53 git clone http://repo.or.cz/r/openocd.git
55 2. Set up Gerrit with your local repository. All this does it
56 to instruct git locally how to send off the changes.
58 Add a new remote to git using Gerrit username:
60 git remote add review ssh://USERNAME@openocd.zylin.com:29418/openocd.git
61 git config remote.review.push HEAD:refs/for/master
63 You will need to install this hook, we will look into a better
64 solution:
66 scp -p -P 29418 USERNAME@openocd.zylin.com:hooks/commit-msg .git/hooks/
68 3. Set up git with your name and email:
70 git config --global user.name "John Smith"
71 git config --global user.email "john@smith.org"
73 4. Work on your patches. Split the work into 
74 multiple small patches that can be reviewed and
75 applied seperately and safely to the OpenOCD
76 repository.
78 while(!done) {
79   work - edit files using your favorite editor.
80   run "git commit -s -a" to commit all changes. 
83 TIP! use "git add ." before commit to add new files.
85 --- example comment, notice the short first line w/topic ---
86 topic: short comment
87 <blank line>
88 longer comments over several
89 lines...
90 -----
92 5. Next you need to make sure that your patches
93 are on top of the latest stuff on the server and
94 that there are no conflicts.
96 git pull --rebase origin/master
98 6. Send the patches to the Gerrit server for review.
100 git push review
102 7. Forgot something, want to add more? Just make the changes and do:
104 git commit --amend
105 git push review
107 Further reading:
109 http://www.coreboot.org/Git